From 7f43e4918715330c1407d5723ce73d023ca4229c Mon Sep 17 00:00:00 2001 From: jvican Date: Fri, 1 Jul 2016 11:05:24 +0200 Subject: [PATCH] Add straightforward fix to #1308 --- src/dotty/tools/dotc/typer/Typer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index ae8900c435e3..268020ec51d3 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -566,7 +566,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def typedIf(tree: untpd.If, pt: Type)(implicit ctx: Context) = track("typedIf") { val cond1 = typed(tree.cond, defn.BooleanType) val thenp1 = typed(tree.thenp, pt) - val elsep1 = typed(tree.elsep orElse untpd.unitLiteral withPos tree.pos, pt) + val elsep1 = typed(tree.elsep orElse (untpd.unitLiteral withPos tree.pos), pt) val thenp2 :: elsep2 :: Nil = harmonize(thenp1 :: elsep1 :: Nil) assignType(cpy.If(tree)(cond1, thenp2, elsep2), thenp2, elsep2) }