From abc12d772c30e4e54f5740569950c730de008c2e Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 7 Nov 2014 19:23:04 +1000 Subject: SI-7784 Allow a singleton type over a constant value defn. When typechecking a `SingletonTypeTree`, we must `deconst` the type of the typechecked reference tree to avoid collapsing `a.type` into a constant type if `a` is a constant value definition. --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index e883bacc88..7f86a59164 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -5193,7 +5193,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper if (refTyped.isErrorTyped) { setError(tree) } else { - tree setType refTyped.tpe.resultType + tree setType refTyped.tpe.resultType.deconst if (refTyped.isErrorTyped || treeInfo.admitsTypeSelection(refTyped)) tree else UnstableTreeError(tree) } -- cgit v1.2.3