diff options
author | Martin Odersky <odersky@gmail.com> | 2007-03-23 11:35:42 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-03-23 11:35:42 +0000 |
commit | 44678c37b1a3975e101ca004d6808e13b9794759 (patch) | |
tree | 2b53de2e89fbb847e1054c35d53a7a48150edf22 /src/compiler | |
parent | 4c5b8cd11c4be478add14845fb416d537f974b30 (diff) | |
download | scala-44678c37b1a3975e101ca004d6808e13b9794759.tar.gz scala-44678c37b1a3975e101ca004d6808e13b9794759.tar.bz2 scala-44678c37b1a3975e101ca004d6808e13b9794759.zip |
fixed bug1010
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 10 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 166c455dff..9e30b254aa 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1740,6 +1740,16 @@ trait Types requires SymbolTable { } else toPrefix(base(pre, clazz).prefix, clazz.owner); toPrefix(pre, clazz) + case SingleType(pre, sym) => + if (sym.isPackageClass) tp // short path + else { + val v = variance; variance = 0 + val pre1 = this(pre) + variance = v + if (pre1 eq pre) tp + else if (pre1.isStable) singleType(pre1, sym, variance) + else pre1.memberType(sym).resultType + } case TypeRef(prefix, sym, args) if (sym.isTypeParameter) => def toInstance(pre: Type, clazz: Symbol): Type = if ((pre eq NoType) || (pre eq NoPrefix) || !clazz.isClass) tp diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 0d5175a0f8..a75a5c88a8 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -360,6 +360,7 @@ trait Infer requires Analyzer { pre.memberType(sym1) } catch { case ex: MalformedType => + if (settings.debug.value) ex.printStackTrace val sym2 = underlying(sym1) val itype = withoutMalformedChecks(pre.memberType(sym2)) accessError("\n because its instance type "+itype+ |