aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-15 13:56:12 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-21 17:41:13 +0200
commit3d9d90e1a29a80f9df968a0e53e01ecb31c397c7 (patch)
treebfe840e089e8c49a4b6b9c0cb45dc27e5c4ea9ea /src/dotty/tools/dotc/core/TypeOps.scala
parent89145d0e166a3042d7530b037a5664f3b1d4f22e (diff)
downloaddotty-3d9d90e1a29a80f9df968a0e53e01ecb31c397c7.tar.gz
dotty-3d9d90e1a29a80f9df968a0e53e01ecb31c397c7.tar.bz2
dotty-3d9d90e1a29a80f9df968a0e53e01ecb31c397c7.zip
Make normalizeToRef survive annotated types
Did not handle this case before.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala9
1 files changed, 5 insertions, 4 deletions
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")
}