diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-15 10:56:41 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-15 10:57:16 +0100 |
commit | 3d9a664e75307410b8845ecc1540a00924867912 (patch) | |
tree | d9ae348b660156897d97a0162d83aa424236ec6f /src/dotty/tools/dotc/typer/Typer.scala | |
parent | a709a72cd2ff64e5fb81a388d95f85c62ede7db3 (diff) | |
download | dotty-3d9a664e75307410b8845ecc1540a00924867912.tar.gz dotty-3d9a664e75307410b8845ecc1540a00924867912.tar.bz2 dotty-3d9a664e75307410b8845ecc1540a00924867912.zip |
Fix for constant folding
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 a40062127..61ab0ed56 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1205,7 +1205,7 @@ class Typer extends Namer with Applications with Implicits { def adaptToSubType(wtp: Type): Tree = { // try converting a constant to the target type val folded = ConstFold(tree, pt) - if (folded ne EmptyTree) return folded + if (folded ne tree) return folded // drop type if prototype is Unit if (pt isRef defn.UnitClass) return tpd.Block(tree :: Nil, Literal(Constant(()))) |