summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-06-21 06:53:38 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-06-23 08:43:54 +1000
commit4a61719c1a3b57b47aa65409e83b87cff39145d3 (patch)
tree573c6aa26eedad79624c8eeba1c5e94e27b46377 /src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
parentf8d816086f56096c05dfc769aa1ab0f6e583bb5a (diff)
downloadscala-4a61719c1a3b57b47aa65409e83b87cff39145d3.tar.gz
scala-4a61719c1a3b57b47aa65409e83b87cff39145d3.tar.bz2
scala-4a61719c1a3b57b47aa65409e83b87cff39145d3.zip
SI-8892 Fix incorrect qualification in error message
Since beadafa2, we've ended up with nutty error messages for type errors involving aliases that target types in `java.lang` and `scala` packages. I think the intent of that change was to force the error messages to qualify types like `String` when needed, but to leave them unqualified by default. However, this led to this flat out wrong message in the enclosed test. found : B required: C.this.java.lang.B (which expands to) String I've changed the heuristic slightly limit this code to aliases that are eponymous with their targets. Still feels pretty kludgy, but we can at least book a little progress.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
index 65dea3178b..5f2643cb25 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
@@ -318,7 +318,7 @@ trait TypeDiagnostics {
*/
def qualifyDefaultNamespaces() = {
val intersect = Set(trueOwner, aliasOwner) intersect UnqualifiedOwners
- if (intersect.nonEmpty) preQualify()
+ if (intersect.nonEmpty && tp.typeSymbolDirect.name == tp.typeSymbol.name) preQualify()
}
// functions to manipulate the name