diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 10:17:27 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 10:17:27 -0800 |
commit | 637f239b19ded6b5a3b7b8c06fa64bb0a9f85578 (patch) | |
tree | f64e327a92e7f4a36ca928e1d7382d5aca9c1958 /src | |
parent | 4371969ddca5c8711f4b973f84db5062d6103760 (diff) | |
parent | b2b9cf4f8c8ff8a00d19aabd56f0602c2aced4b3 (diff) | |
download | scala-637f239b19ded6b5a3b7b8c06fa64bb0a9f85578.tar.gz scala-637f239b19ded6b5a3b7b8c06fa64bb0a9f85578.tar.bz2 scala-637f239b19ded6b5a3b7b8c06fa64bb0a9f85578.zip |
Merge pull request #3214 from retronym/ticket/8024
SI-8024 Fix inaccurate message on overloaded ambiguous ident
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 2b4417a80d..53bc9a2772 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -1126,7 +1126,7 @@ trait Contexts { self: Analyzer => impSym = NoSymbol // Otherwise they are irreconcilably ambiguous else - return ambiguousDefnAndImport(defSym.owner, imp1) + return ambiguousDefnAndImport(defSym.alternatives.head.owner, imp1) } // At this point only one or the other of defSym and impSym might be set. diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 52d035eadb..0dfcf06874 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -2482,10 +2482,14 @@ trait Symbols extends api.Symbols { self: SymbolTable => /** String representation, including symbol's kind e.g., "class Foo", "method Bar". * If hasMeaninglessName is true, uses the owner's name to disambiguate identity. */ - override def toString: String = compose( - kindString, - if (hasMeaninglessName) owner.decodedName + idString else nameString - ) + override def toString: String = { + if (isPackageObjectOrClass && !settings.debug) + s"package object ${owner.decodedName}" + else compose( + kindString, + if (hasMeaninglessName) owner.decodedName + idString else nameString + ) + } /** String representation of location. */ |