diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 6 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 10 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index b26045f1d8..7d72d2ee2f 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -862,7 +862,7 @@ trait Types { while (j < clSize) { closureCache(j) match { case RefinedType(parents, decls) => - assert(decls.isEmpty) + if (!decls.isEmpty) assert(false, "computing closure of "+this+":"+this.isInstanceOf[RefinedType]) //Console.println("compute closure of "+this+" => glb("+parents+")") closureCache(j) = mergePrefixAndArgs(parents, -1, maxClosureDepth(parents) + LubGlbMargin) match { case Some(tp0) => tp0 @@ -1213,7 +1213,9 @@ A type's symbol should never be inspected directly. override def typeOfThis = transform(sym.typeOfThis) override def narrow = - if (sym.isModuleClass) transform(sym.thisType) else super.narrow + if (sym.isModuleClass) transform(sym.thisType) + else if (sym.isAliasType) normalize.narrow + else super.narrow override def prefix: Type = if (sym.isAliasType) normalize.prefix else pre diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 2e1b250eee..a623a67fd4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -55,7 +55,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT val decls = tree.symbol.info.decls for (val sym <- decls.toList) { if (sym.privateWithin.isClass && !sym.privateWithin.isModuleClass && - !sym.hasFlag(EXPANDEDNAME)) { + !sym.hasFlag(EXPANDEDNAME) && !sym.isConstructor) { decls.unlink(sym) sym.expandName(sym.privateWithin) decls.enter(sym) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 256244313a..3c6a56d8af 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1603,7 +1603,7 @@ trait Typers requires Analyzer { arg.tpe = typer1.infer.inferTypedPattern(tree.pos, unappFormal, arg.tpe) //todo: replace arg with arg.asInstanceOf[inferTypedPattern(unappFormal, arg.tpe)] instead. } - + // Console.println("unapply "+fun.tpe) val fun1untyped = atPos(fun.pos) { Apply( Select( @@ -2611,8 +2611,12 @@ trait Typers requires Analyzer { tree setType ref1.tpe.resultType case SelectFromTypeTree(qual, selector) => - val sel = typedSelect(typedType(qual), selector) - tree setSymbol sel.symbol setType typedSelect(typedType(qual), selector).tpe +/* maybe need to do this: + val res = typedSelect(typedType(qual), selector) + tree setType res.tpe setSymbol res.symbol + res +*/ + typedSelect(typedType(qual), selector) case CompoundTypeTree(templ) => typedCompoundTypeTree(templ) |