diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-07 12:58:33 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:45:37 +0100 |
commit | 8978ae6dfabae562fb5dcf4c7f66983d4d865892 (patch) | |
tree | 999cd971a10b46ec307c550a5af464329495c6c9 /src/dotty/tools/dotc/transform/TypeTestsCasts.scala | |
parent | f2b61ce055fccf96e305ef43fca8abef8a912f33 (diff) | |
download | dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.tar.gz dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.tar.bz2 dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.zip |
First versions of Definitions based on TypeRefs not Symbols.
Symbols are not stable between runs, so if some symbol referred
to from Definitions gets recompiled, there are then two Symbols
that are both visible, one referenced from Definitions, the other
the one that got compiled.
Thos led to a crash when e.g. compiling scala.Short, because the
newly compiled symbol was not recognized as a primitive value
class.
The present commit tries to make systematic changes without regard
to simplicity or aesthetics. This will be polished in future commits.
// ### comments signal areas that need further attention.
Diffstat (limited to 'src/dotty/tools/dotc/transform/TypeTestsCasts.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/TypeTestsCasts.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index b2d45b661..80c3b654e 100644 --- a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -50,7 +50,7 @@ trait TypeTestsCasts { Literal(Constant(true)) withPos tree.pos else if (argCls.isPrimitiveValueClass) if (qualCls.isPrimitiveValueClass) Literal(Constant(qualCls == argCls)) withPos tree.pos - else transformIsInstanceOf(expr, defn.boxedClass(argCls).typeRef) + else transformIsInstanceOf(expr, defn.boxedTypeRef(argCls.typeRef)) // ### unstable else argType.dealias match { case _: SingletonType => val cmpOp = if (argType derivesFrom defn.AnyValClass) defn.Any_equals else defn.Object_eq @@ -70,7 +70,7 @@ trait TypeTestsCasts { } case defn.MultiArrayType(elem, ndims) if isUnboundedGeneric(elem) => def isArrayTest(arg: Tree) = - ref(defn.runtimeMethod(nme.isArray)).appliedTo(arg, Literal(Constant(ndims))) + ref(defn.runtimeMethodRef(nme.isArray)).appliedTo(arg, Literal(Constant(ndims))) if (ndims == 1) isArrayTest(qual) else evalOnce(qual) { qual1 => derivedTree(qual1, defn.Any_isInstanceOf, qual1.tpe) and isArrayTest(qual1) |