diff options
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/TypeTestsCasts.scala | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 59adf764e..5348bac31 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -255,6 +255,8 @@ object Types { * value type, or because superclasses are ambiguous). */ final def classSymbol(implicit ctx: Context): Symbol = this match { + case ConstantType(constant) => + constant.tpe.classSymbol case tp: TypeRef => val sym = tp.symbol if (sym.isClass) sym else tp.underlying.classSymbol diff --git a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index 8c9ffb1fb..4f5c47c99 100644 --- a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -78,7 +78,7 @@ class TypeTestsCasts extends MiniPhaseTransform { } def transformAsInstanceOf(argType: Type): Tree = { - def argCls = argType.classSymbol + def argCls = argType.widen.classSymbol if (qual.tpe <:< argType) Typed(qual, tree.args.head) else if (qualCls.isPrimitiveValueClass) { |