summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-11-01 12:06:20 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-11-01 12:06:20 -0700
commitea3b00e208b0df2deab22da57d28e17377e46e46 (patch)
treeaba630e00116ba8400418fa14d1af39d531f1f30 /src
parent64e60035f6eb8436ba516ca8378decbb8ea01abe (diff)
parentfb6e68713060e7904a7d93012470a946ca7e2375 (diff)
downloadscala-ea3b00e208b0df2deab22da57d28e17377e46e46.tar.gz
scala-ea3b00e208b0df2deab22da57d28e17377e46e46.tar.bz2
scala-ea3b00e208b0df2deab22da57d28e17377e46e46.zip
Merge pull request #1542 from adriaanm/odersky-ticket/6556v2
SI-6556 no assert for surprising ctor result type
Diffstat (limited to 'src')
-rw-r--r--src/reflect/scala/reflect/internal/transform/Erasure.scala14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/transform/Erasure.scala b/src/reflect/scala/reflect/internal/transform/Erasure.scala
index 977398909f..52d1657dc3 100644
--- a/src/reflect/scala/reflect/internal/transform/Erasure.scala
+++ b/src/reflect/scala/reflect/internal/transform/Erasure.scala
@@ -214,6 +214,9 @@ trait Erasure {
specialConstructorErasure(clazz, restpe)
case ExistentialType(tparams, restpe) =>
specialConstructorErasure(clazz, restpe)
+ case RefinedType(parents, decls) =>
+ specialConstructorErasure(
+ clazz, specialScalaErasure.mergeParents(parents))
case mt @ MethodType(params, restpe) =>
MethodType(
cloneSymbolsAndModify(params, specialScalaErasure),
@@ -221,7 +224,16 @@ trait Erasure {
case TypeRef(pre, `clazz`, args) =>
typeRef(pre, clazz, List())
case tp =>
- assert(clazz == ArrayClass || tp.isError, s"unexpected constructor erasure $tp for $clazz")
+ if (!(clazz == ArrayClass || tp.isError))
+ // See SI-6556. It seems in some cases the result constructor
+ // type of an anonymous class is a different version of the class.
+ // This has nothing to do with value classes per se.
+ // We simply used a less discriminating transform before, that
+ // did not look at the cases in detail.
+ // It seems there is a deeper problem here, which needs
+ // following up to. But we will not risk regressions
+ // in 2.10 because of it.
+ log(s"!!! unexpected constructor erasure $tp for $clazz")
specialScalaErasure(tp)
}
}