summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-22 13:40:02 -0700
committerPaul Phillips <paulp@improving.org>2013-03-22 13:40:02 -0700
commita16441c1d2b35980b3cca22325b1b826c5c684a4 (patch)
tree61a0d2631c570ff84b25ed6ef2586ca147b84656 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
parent426cec50f343f6c936349e7e0cab774423218d66 (diff)
parent4bb8988e0263206fc914537c7762b0ee3b9057aa (diff)
downloadscala-a16441c1d2b35980b3cca22325b1b826c5c684a4.tar.gz
scala-a16441c1d2b35980b3cca22325b1b826c5c684a4.tar.bz2
scala-a16441c1d2b35980b3cca22325b1b826c5c684a4.zip
Merge pull request #2259 from Blaisorblade/issue/6123-try-3
SI-6123: -explaintypes should not explain errors which won't be reported, new attempt
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index 86ee7939c8..17e679b5dd 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -172,8 +172,7 @@ trait ContextErrors {
assert(!foundType.isErroneous && !req.isErroneous, (foundType, req))
issueNormalTypeError(tree, withAddendum(tree.pos)(typeErrorMsg(foundType, req, infer.isPossiblyMissingArgs(foundType, req))) )
- if (settings.explaintypes.value)
- explainTypes(foundType, req)
+ infer.explainTypes(foundType, req)
}
def WithFilterError(tree: Tree, ex: AbsTypeError) = {
@@ -1273,11 +1272,12 @@ trait ContextErrors {
// not exactly an error generator, but very related
// and I dearly wanted to push it away from Macros.scala
private def checkSubType(slot: String, rtpe: Type, atpe: Type) = {
- val ok = if (macroDebugVerbose || settings.explaintypes.value) {
- if (rtpe eq atpe) println(rtpe + " <: " + atpe + "?" + EOL + "true")
+ val ok = if (macroDebugVerbose) {
withTypesExplained(rtpe <:< atpe)
} else rtpe <:< atpe
if (!ok) {
+ if (!macroDebugVerbose)
+ explainTypes(rtpe, atpe)
compatibilityError("type mismatch for %s: %s does not conform to %s".format(slot, abbreviateCoreAliases(rtpe.toString), abbreviateCoreAliases(atpe.toString)))
}
}