diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-04-15 19:29:44 +0200 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-04-15 19:36:44 +0200 |
commit | a370eed7bebbc534e19de7dadefd72a70349854f (patch) | |
tree | c246d5be1e1e94ef4b0ac4860af722613c56e1b3 /compiler/src/dotty/tools/dotc/ast | |
parent | f20ca3d358c650f6a58528018aa7d848b1f6a28f (diff) | |
download | dotty-a370eed7bebbc534e19de7dadefd72a70349854f.tar.gz dotty-a370eed7bebbc534e19de7dadefd72a70349854f.tar.bz2 dotty-a370eed7bebbc534e19de7dadefd72a70349854f.zip |
Fix #2266: Do not replace constant type lazy vals with constant.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/ast')
-rw-r--r-- | compiler/src/dotty/tools/dotc/ast/TreeInfo.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index f3bce4000..cac0e4b91 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -427,7 +427,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => def constToLiteral(tree: Tree)(implicit ctx: Context): Tree = { val tree1 = ConstFold(tree) tree1.tpe.widenTermRefExpr match { - case ConstantType(value) if isIdempotentExpr(tree1) => Literal(value) + case ConstantType(value) if isIdempotentExpr(tree1) && !tree1.symbol.is(Lazy) => Literal(value) case _ => tree1 } } |