Created
June 11, 2010 02:18
-
-
Save harrah/433951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala | |
=================================================================== | |
--- src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala (revision 22206) | |
+++ src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala (working copy) | |
@@ -218,6 +218,8 @@ | |
modifyName(x)("scala." + _) | |
else if (x.isTypeParameterOrSkolem) | |
explainName(x) | |
+ else if (x.nameString.forall(!_.isLetterOrDigit) && !isAlreadyAltered(x)) // symbol-only names are normally printed without prefixes | |
+ modifyName(x)(_ => " " + x.fullName) | |
} | |
} | |
} | |
Index: src/compiler/scala/tools/nsc/symtab/Types.scala | |
=================================================================== | |
--- src/compiler/scala/tools/nsc/symtab/Types.scala (revision 22206) | |
+++ src/compiler/scala/tools/nsc/symtab/Types.scala (working copy) | |
@@ -1826,6 +1826,8 @@ | |
return normalize.typeArgs.init.mkString("(", ", ", ")") + " => " + normalize.typeArgs.last | |
if (isTupleType(this)) | |
return normalize.typeArgs.mkString("(", ", ", if (normalize.typeArgs.length == 1) ",)" else ")") | |
+ if (normalize.typeArgs.length == 2 && (sym.nameString.forall(c => !c.isLetterOrDigit) || sym.nameString.startsWith(" ") )) | |
+ return normalize.typeArgs.mkString("(", " " + sym.nameString.trim + " ", ")") | |
if (sym.isAliasType && (prefixChain exists (_.termSymbol hasFlag SYNTHETIC))) { | |
val normed = normalize; | |
if (normed ne this) return normed.toString |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment