Skip to content

Commit 07fd8a3

Browse files
authored
Merge pull request #1350 from dotty-jvican/issue-1308
Add straightforward fix to #1308
2 parents b35eff9 + 7f43e49 commit 07fd8a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
566566
def typedIf(tree: untpd.If, pt: Type)(implicit ctx: Context) = track("typedIf") {
567567
val cond1 = typed(tree.cond, defn.BooleanType)
568568
val thenp1 = typed(tree.thenp, pt)
569-
val elsep1 = typed(tree.elsep orElse untpd.unitLiteral withPos tree.pos, pt)
569+
val elsep1 = typed(tree.elsep orElse (untpd.unitLiteral withPos tree.pos), pt)
570570
val thenp2 :: elsep2 :: Nil = harmonize(thenp1 :: elsep1 :: Nil)
571571
assignType(cpy.If(tree)(cond1, thenp2, elsep2), thenp2, elsep2)
572572
}

0 commit comments

Comments
 (0)