diff options
author | Martin Odersky <odersky@gmail.com> | 2009-10-12 09:41:13 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-10-12 09:41:13 +0000 |
commit | f75ee36c6fb4386eb89f19c40dfa000076aa9307 (patch) | |
tree | 1c43adb5b8b194a7a9c14d4ad7cdca04261cda68 /src/compiler | |
parent | bf9ca9a2b7455164c335a48826143749b6b107eb (diff) | |
download | scala-f75ee36c6fb4386eb89f19c40dfa000076aa9307.tar.gz scala-f75ee36c6fb4386eb89f19c40dfa000076aa9307.tar.bz2 scala-f75ee36c6fb4386eb89f19c40dfa000076aa9307.zip |
reverted immutable.Vector because it gave rando...
reverted immutable.Vector because it gave random build errors on my
machine. Fixed various tickets, updated test and check files.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 18 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 18 |
2 files changed, 27 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 47ede4228e..6b3d24ffa2 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -3247,6 +3247,9 @@ A type's typeSymbol should never be inspected directly. } } + class MissingAliasException extends Exception + val missingAliasException = new MissingAliasException + object adaptToNewRunMap extends TypeMap { private def adaptToNewRun(pre: Type, sym: Symbol): Symbol = { if (sym.isModuleClass && !phase.flatClasses) { @@ -3256,7 +3259,9 @@ A type's typeSymbol should never be inspected directly. } else { var rebind0 = pre.findMember(sym.name, BRIDGE, 0, true)(NoSymbol) if (rebind0 == NoSymbol) { - assert(false, ""+pre+"."+sym+" does no longer exist, phase = "+phase) } + if (sym.isAliasType) throw missingAliasException + assert(false, pre+"."+sym+" does no longer exist, phase = "+phase) + } /** The two symbols have the same fully qualified name */ def corresponds(sym1: Symbol, sym2: Symbol): Boolean = sym1.name == sym2.name && (sym1.isPackageClass || corresponds(sym1.owner, sym2.owner)) @@ -3294,9 +3299,14 @@ A type's typeSymbol should never be inspected directly. else { val pre1 = this(pre) val args1 = args mapConserve (this) - val sym1 = adaptToNewRun(pre1, sym) - if ((pre1 eq pre) && (sym1 eq sym) && (args1 eq args)/* && sym.isExternal*/) tp - else typeRef(pre1, sym1, args1) + try { + val sym1 = adaptToNewRun(pre1, sym) + if ((pre1 eq pre) && (sym1 eq sym) && (args1 eq args)/* && sym.isExternal*/) tp + else typeRef(pre1, sym1, args1) + } catch { + case ex: MissingAliasException => + apply(tp.dealias) + } } case MethodType(params, restp) => val restp1 = this(restp) diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 133c0c1b3e..a83ce8e53b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -735,10 +735,15 @@ self: Analyzer => "classType", tp, (if ((pre eq NoPrefix) || pre.typeSymbol.isStaticOwner) suffix else findSubManifest(pre) :: suffix): _*) - } else if (sym.isAbstractType && !sym.isTypeParameterOrSkolem && !sym.isExistential) { - manifestFactoryCall( - "abstractType", tp, - findSubManifest(pre) :: Literal(sym.name.toString) :: findManifest(tp0.bounds.hi) :: (args map findSubManifest): _*) + } else if (sym.isAbstractType) { + if (sym.isExistential) + EmptyTree // todo: change to existential parameter manifest + else if (sym.isTypeParameterOrSkolem) + EmptyTree // a manifest should have been found by normal searchImplicit + else + manifestFactoryCall( + "abstractType", tp, + findSubManifest(pre) :: Literal(sym.name.toString) :: findManifest(tp0.bounds.hi) :: (args map findSubManifest): _*) } else { EmptyTree // a manifest should have been found by normal searchImplicit } @@ -747,7 +752,10 @@ self: Analyzer => if (parents.length == 1) findManifest(parents.head) else manifestFactoryCall("intersectionType", tp, parents map (findSubManifest(_)): _*) case ExistentialType(tparams, result) => - mot(result) + existentialAbstraction(tparams, result) match { + case ExistentialType(_, _) => mot(result) + case t => mot(t) + } case _ => EmptyTree } |