summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-04-09 10:09:26 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-04-09 10:09:26 -0700
commitc05d2a41dc9b044370abf9ba1ceaafbb2cde5652 (patch)
tree7dfff37a6052b85961aa67012046d1dba9814278 /src
parent2a22b86ea0dd2bc9cdda14e24f8ada8cd68b6837 (diff)
parent72503126d9c29ff029c4c9537234e1fb1d7a0130 (diff)
downloadscala-c05d2a41dc9b044370abf9ba1ceaafbb2cde5652.tar.gz
scala-c05d2a41dc9b044370abf9ba1ceaafbb2cde5652.tar.bz2
scala-c05d2a41dc9b044370abf9ba1ceaafbb2cde5652.zip
Merge pull request #2365 from u-abramchuk/SI6386
SI-6386 typed existential type tree's original now have tpe set
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 34ba8b46f9..d1d6feae97 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3887,8 +3887,16 @@ trait Typers extends Modes with Adaptations with Tags {
if (vd.symbol.tpe.isVolatile)
AbstractionFromVolatileTypeError(vd)
val tpt1 = typedType(tree.tpt, mode)
- existentialTransform(tree.whereClauses map (_.symbol), tpt1.tpe)((tparams, tp) =>
- TypeTree(newExistentialType(tparams, tp)) setOriginal tree
+ existentialTransform(tree.whereClauses map (_.symbol), tpt1.tpe)((tparams, tp) => {
+ val original = tpt1 match {
+ case tpt : TypeTree => atPos(tree.pos)(ExistentialTypeTree(tpt.original, tree.whereClauses))
+ case _ => {
+ debuglog(s"cannot reconstruct the original for $tree, because $tpt1 is not a TypeTree")
+ tree
+ }
+ }
+ TypeTree(newExistentialType(tparams, tp)) setOriginal original
+ }
)
}