From 0288a0788ae1ffbe9064992f1ac02f647bb64c17 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 17 Feb 2012 13:57:06 -0800 Subject: Fix for "type _$1 defined twice". Actually not a fix, only a workaround. Package objects strike again: you don't want to have existentials in there, like this: private val resolverFunction: PartialFunction[Throwable, Try[_]] = ... There are a few irrelevant-to-that-bug changes included which I did while debugging and figured I'd keep them. With this patch I can merge/am merging the scala.concurrent work. --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index fe6dcc9138..e3a59058a3 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1205,7 +1205,7 @@ self => */ def wildcardType(start: Int) = { val pname = freshTypeName("_$") - val t = atPos(start) { Ident(pname) } + val t = atPos(start)(Ident(pname)) val bounds = typeBounds() val param = atPos(t.pos union bounds.pos) { makeSyntheticTypeParam(pname, bounds) } placeholderTypes = param :: placeholderTypes diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 23fc30b9fb..e7cd139ce0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2169,6 +2169,10 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { // error for this is issued in RefChecks.checkDefaultsInOverloaded if (!e.sym.isErroneous && !e1.sym.isErroneous && !e.sym.hasDefaultFlag && !e.sym.hasAnnotation(BridgeClass) && !e1.sym.hasAnnotation(BridgeClass)) { + log("Double definition detected:\n " + + ((e.sym.getClass, e.sym.info, e.sym.ownerChain)) + "\n " + + ((e1.sym.getClass, e1.sym.info, e1.sym.ownerChain))) + DefDefinedTwiceError(e.sym, e1.sym) scope.unlink(e1) // need to unlink to avoid later problems with lub; see #2779 } -- cgit v1.2.3