diff options
author | Martin Odersky <odersky@gmail.com> | 2013-01-06 12:51:46 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-01-06 12:51:46 +0100 |
commit | 950ecd092b442f8e8ea2eb9e21f3eedfd3d41b80 (patch) | |
tree | 05ec4e36404f1fb90ee75886bae25e81730a6170 /src | |
parent | 0811af43037219946d07f83c5a80aeaa2f1d4cfa (diff) | |
parent | 01c99aa384b42e3d19bb7e8e0f7b85ea9102e199 (diff) | |
download | dotty-950ecd092b442f8e8ea2eb9e21f3eedfd3d41b80.tar.gz dotty-950ecd092b442f8e8ea2eb9e21f3eedfd3d41b80.tar.bz2 dotty-950ecd092b442f8e8ea2eb9e21f3eedfd3d41b80.zip |
Merge remote-tracking branch 'origin/master'
Conflicts:
src/dotty/tools/dotc/core/Types.scala
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 0121bca6f..43278df68 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -321,18 +321,17 @@ object Types { def typeArgs: List[Type] = ??? def asSeenFrom(pre: Type, clazz: Symbol)(implicit ctx: Context): Type = - if (ctx.erasedTypes && clazz != defn.ArrayClass || - clazz.isStaticMono) this + if (clazz.isStaticMono || ctx.erasedTypes && clazz != defn.ArrayClass ) this else asSeenFrom(pre, clazz, null) - def asSeenFrom(pre: Type, clazz: Symbol, map: AsSeenFromMap)(implicit ctx: Context): Type = { + def asSeenFrom(pre: Type, clazz: Symbol, theMap: AsSeenFromMap)(implicit ctx: Context): Type = { def skipPrefixOf(pre: Type, clazz: Symbol) = (pre eq NoType) || (pre eq NoPrefix) || clazz.isPackageClass - def toPrefix(pre: Type, clazz: Symbol, thisclazz: ClassSymbol, tp: Type): Type = + def toPrefix(pre: Type, clazz: Symbol, thisclazz: ClassSymbol): Type = if (skipPrefixOf(pre, clazz)) - tp + this else if ((thisclazz isNonBottomSubClass clazz) && (pre.widen.typeSymbol isNonBottomSubClass thisclazz)) pre match { @@ -342,8 +341,8 @@ object Types { else toPrefix(pre.baseType(clazz).normalizedPrefix, clazz.owner, thisclazz, tp) - def toInstance(pre: Type, clazz: Symbol, tparam: Symbol, tp: Type): Type = { - if (skipPrefixOf(pre, clazz)) tp + def toInstance(pre: Type, clazz: Symbol, tparam: Symbol): Type = { + if (skipPrefixOf(pre, clazz)) this else { val tparamOwner = tparam.owner @@ -381,14 +380,13 @@ object Types { this match { case tp: NamedType => val sym = tp.symbol - if (tp.symbol.isTypeParameter) - toInstance(pre, clazz, sym, this) - else - tp.derivedNamedType(tp.prefix.asSeenFrom(pre, clazz), tp.name) + if (tp.symbol.isTypeParameter) toInstance(pre, clazz, sym) + else if (sym.isStatic) this + else tp.derivedNamedType(tp.prefix.asSeenFrom(pre, clazz, theMap), tp.name) case ThisType(thisclazz) => - toPrefix(pre, clazz, thisclazz, this) + toPrefix(pre, clazz, thisclazz) case _ => - val asSeenFromMap = if (map != null) map else new AsSeenFromMap(pre, clazz) + val asSeenFromMap = if (theMap != null) theMap else new AsSeenFromMap(pre, clazz) this match { case tp: AppliedType => tp.derivedAppliedType( |