summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala12
-rw-r--r--test/files/pos/t6386.scala5
2 files changed, 15 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
+ }
)
}
diff --git a/test/files/pos/t6386.scala b/test/files/pos/t6386.scala
new file mode 100644
index 0000000000..85098a78f0
--- /dev/null
+++ b/test/files/pos/t6386.scala
@@ -0,0 +1,5 @@
+import scala.reflect.runtime.universe._
+
+object Test extends App {
+ reify(manifest[Some[_]])
+} \ No newline at end of file