Skip to content

Commit 73192b6

Browse files
oderskyMasseGuillaume
authored andcommitted
Address reviewer comments
1 parent 3c7053f commit 73192b6

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
@@ -573,7 +573,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
573573
def typedBlock(tree: untpd.Block, pt: Type)(implicit ctx: Context) = track("typedBlock") {
574574
val exprCtx = index(tree.stats)
575575
val stats1 = typedStats(tree.stats, ctx.owner)
576-
val ept = if (tree.isInstanceOf[untpd.InfixOpBlock]) pt else pt.notApplied
576+
val ept =
577+
if (tree.isInstanceOf[untpd.InfixOpBlock])
578+
// Right-binding infix operations are expanded to InfixBlocks, which may be followed by arguments.
579+
// Example: `(a /: bs)(op)` expands to `{ val x = a; bs./:(x) } (op)` where `{...}` is an InfixBlock.
580+
pt
581+
else pt.notApplied
577582
val expr1 = typedExpr(tree.expr, ept)(exprCtx)
578583
ensureNoLocalRefs(
579584
assignType(cpy.Block(tree)(stats1, expr1), stats1, expr1), pt, localSyms(stats1))

0 commit comments

Comments
 (0)