diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-02 13:39:48 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | 729815bec8035f2d6132fde0eb928e877dd21a64 (patch) | |
tree | 27b8efddae77f9d3a9e28ddd1dea72186096ff66 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 617be516b261524c2f0762de10f2bde376043ad7 (diff) | |
download | dotty-729815bec8035f2d6132fde0eb928e877dd21a64.tar.gz dotty-729815bec8035f2d6132fde0eb928e877dd21a64.tar.bz2 dotty-729815bec8035f2d6132fde0eb928e877dd21a64.zip |
Implement inline if
Inline conditionals with constant conditions
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index dc41cc567..e809605f4 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -609,7 +609,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit em"local definition of ${leaks.head.name} escapes as part of expression's type ${tree.tpe}"/*; full type: ${result.tpe.toString}"*/) } - def typedIf(tree: untpd.If, pt: Type)(implicit ctx: Context) = track("typedIf") { + def typedIf(tree: untpd.If, pt: Type)(implicit ctx: Context): Tree = track("typedIf") { val cond1 = typed(tree.cond, defn.BooleanType) val thenp1 = typed(tree.thenp, pt.notApplied) val elsep1 = typed(tree.elsep orElse (untpd.unitLiteral withPos tree.pos), pt.notApplied) |