diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-18 10:23:09 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-09-18 10:23:09 +0200 |
commit | 440eddd665d043bd609c3749b5cd5606cd5d4e3e (patch) | |
tree | 4c1f4b5dec8a3e04385b6288898125c8333e86c2 /src | |
parent | 528f6b0524c465a3e795aa5bb538c680956bf6d2 (diff) | |
download | dotty-440eddd665d043bd609c3749b5cd5606cd5d4e3e.tar.gz dotty-440eddd665d043bd609c3749b5cd5606cd5d4e3e.tar.bz2 dotty-440eddd665d043bd609c3749b5cd5606cd5d4e3e.zip |
Address reviewer comments
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index d788b7e69..46a63555c 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -935,10 +935,10 @@ object Types { case _ => NoType } - /** If this is a FunProto or PolyProto, WildcardType, otherwise this */ + /** If this is a FunProto or PolyProto, WildcardType, otherwise this. */ def notApplied: Type = this - // ----- Normalizing typerefs over refined types ---------------------------- + // ----- Normalizing typerefs over refined types ---------------------------- /** If this normalizes* to a refinement type that has a refinement for `name` (which might be followed * by other refinements), and the refined info is a type alias, return the alias, diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index c59cd38c3..6041e7732 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -572,7 +572,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def typedBlock(tree: untpd.Block, pt: Type)(implicit ctx: Context) = track("typedBlock") { val exprCtx = index(tree.stats) val stats1 = typedStats(tree.stats, ctx.owner) - val ept = if (tree.isInstanceOf[untpd.InfixOpBlock]) pt else pt.notApplied + val ept = + if (tree.isInstanceOf[untpd.InfixOpBlock]) + // Right-binding infix operations are expanded to InfixBlocks, which may be followed by arguments. + // Example: `(a /: bs)(op)` expands to `{ val x = a; bs./:(x) } (op)` where `{...}` is an InfixBlock. + pt + else pt.notApplied val expr1 = typedExpr(tree.expr, ept)(exprCtx) ensureNoLocalRefs( assignType(cpy.Block(tree)(stats1, expr1), stats1, expr1), pt, localSyms(stats1)) |