Skip to content

Commit 440eddd

Browse files
committed
Address reviewer comments
1 parent 528f6b0 commit 440eddd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,10 +935,10 @@ object Types {
935935
case _ => NoType
936936
}
937937

938-
/** If this is a FunProto or PolyProto, WildcardType, otherwise this */
938+
/** If this is a FunProto or PolyProto, WildcardType, otherwise this. */
939939
def notApplied: Type = this
940940

941-
// ----- Normalizing typerefs over refined types ----------------------------
941+
// ----- Normalizing typerefs over refined types ----------------------------
942942

943943
/** If this normalizes* to a refinement type that has a refinement for `name` (which might be followed
944944
* by other refinements), and the refined info is a type alias, return the alias,

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
572572
def typedBlock(tree: untpd.Block, pt: Type)(implicit ctx: Context) = track("typedBlock") {
573573
val exprCtx = index(tree.stats)
574574
val stats1 = typedStats(tree.stats, ctx.owner)
575-
val ept = if (tree.isInstanceOf[untpd.InfixOpBlock]) pt else pt.notApplied
575+
val ept =
576+
if (tree.isInstanceOf[untpd.InfixOpBlock])
577+
// Right-binding infix operations are expanded to InfixBlocks, which may be followed by arguments.
578+
// Example: `(a /: bs)(op)` expands to `{ val x = a; bs./:(x) } (op)` where `{...}` is an InfixBlock.
579+
pt
580+
else pt.notApplied
576581
val expr1 = typedExpr(tree.expr, ept)(exprCtx)
577582
ensureNoLocalRefs(
578583
assignType(cpy.Block(tree)(stats1, expr1), stats1, expr1), pt, localSyms(stats1))

0 commit comments

Comments
 (0)