aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/backend/jvm/GenBCode.scala2
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala9
-rw-r--r--tests/pos/annot.scala2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/dotty/tools/backend/jvm/GenBCode.scala b/src/dotty/tools/backend/jvm/GenBCode.scala
index 7729c3011..db376a452 100644
--- a/src/dotty/tools/backend/jvm/GenBCode.scala
+++ b/src/dotty/tools/backend/jvm/GenBCode.scala
@@ -38,7 +38,7 @@ class GenBCode extends Phase {
def run(implicit ctx: Context): Unit = {
- new GenBCodePipeline(entryPoints.toList, new DottyBackendInterface()(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
+ new GenBCodePipeline(entryPoints.toList, new DottyBackendInterface()(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
entryPoints.clear()
}
}
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 1adabbd2d..acbd5b6f0 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -302,18 +302,19 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
// println(s"normalizing $parents of $cls in ${cls.owner}") // !!! DEBUG
var refinements: SimpleMap[TypeName, Type] = SimpleMap.Empty
var formals: SimpleMap[TypeName, Symbol] = SimpleMap.Empty
- def normalizeToRef(tp: Type): TypeRef = tp match {
+ def normalizeToRef(tp: Type): TypeRef = tp.dealias match {
+ case tp: TypeRef =>
+ tp
case tp @ RefinedType(tp1, name: TypeName) =>
val prevInfo = refinements(name)
refinements = refinements.updated(name,
if (prevInfo == null) tp.refinedInfo else prevInfo & tp.refinedInfo)
formals = formals.updated(name, tp1.typeParamNamed(name))
normalizeToRef(tp1)
- case tp: TypeRef =>
- if (tp.symbol.info.isAlias) normalizeToRef(tp.info.bounds.hi)
- else tp
case ErrorType =>
defn.AnyClass.typeRef
+ case AnnotatedType(_, tpe) =>
+ normalizeToRef(tpe)
case _ =>
throw new TypeError(s"unexpected parent type: $tp")
}
diff --git a/tests/pos/annot.scala b/tests/pos/annot.scala
index 106057258..e6e4f8051 100644
--- a/tests/pos/annot.scala
+++ b/tests/pos/annot.scala
@@ -22,7 +22,7 @@ class Test {
val x: A @uncheckedVariance with B @uncheckedVariance = ???
- //class C extends A @uncheckedVariance () with B @uncheckedVariance { val x = 10 }
+ class C extends A @uncheckedVariance () with B @uncheckedVariance { val x = 10 }
}