diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 14 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 | ||||
-rw-r--r-- | src/library/scala/Function1.scala | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 8bffb80b2b..9df54f371a 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -779,6 +779,20 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { } else tree + case Select(qual, _) => + if (tree.symbol.owner.isRefinementClass) { + var sym: Symbol = NoSymbol + var bcs = tree.symbol.owner.info.baseClasses.tail + //Console.println("resetting "+tree.symbol+tree.symbol.locationString+bcs)//DEBUG + while (!bcs.isEmpty && sym == NoSymbol) { + sym = tree.symbol.overriddenSymbol(bcs.head) + bcs = bcs.tail + } + assert(sym != NoSymbol, tree.symbol) + tree.symbol = sym + } + tree + case Template(parents, body) => assert(!currentOwner.isImplClass) //Console.println("checking no dble defs " + tree)//DEBUG diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 3bc35b2067..6b126feb10 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1666,7 +1666,7 @@ trait Typers requires Analyzer { decode(name)+" is not a member of "+qual.tpe.widen + (if ((context.unit ne null) && Position.line(context.unit.source, qual.pos) < Position.line(context.unit.source, tree.pos)) - "\npossible cause: maybe a semicolon is missing before `"+name+"'?" + "\npossible cause: maybe a semicolon is missing before `"+decode(name)+"'?" else "")) } setError(tree) diff --git a/src/library/scala/Function1.scala b/src/library/scala/Function1.scala index 1b6cb917da..027e0240c9 100644 --- a/src/library/scala/Function1.scala +++ b/src/library/scala/Function1.scala @@ -35,6 +35,5 @@ trait Function1 [-T1, +R] extends AnyRef { override def toString() = "<function>" def compose[A](g: A => T1): A => R = { x => apply(g(x)) } - def andThen[A](g: R => A): T1 => A = g compose this - + def andThen[A](g: R => A): T1 => A = { x => g(apply(x)) } } |