diff options
author | Miles Sabin <miles@milessabin.com> | 2016-05-14 14:12:43 +0100 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2016-05-14 14:12:43 +0100 |
commit | 45e607d3879623d5163f47c17c717904f6867ef6 (patch) | |
tree | 86b5be52bbbe3e03104a78ba93f1218998b4e2da /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | 9e30bee0c9363f6cf36a7b65ddbaaa225b57d6a9 (diff) | |
download | scala-45e607d3879623d5163f47c17c717904f6867ef6.tar.gz scala-45e607d3879623d5163f47c17c717904f6867ef6.tar.bz2 scala-45e607d3879623d5163f47c17c717904f6867ef6.zip |
SI-9361 fixed assert allowing display of improved error message.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index e190b57017..90ccaefe43 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -198,7 +198,7 @@ trait ContextErrors { val foundType: Type = req.dealiasWiden match { case RefinedType(parents, decls) if !decls.isEmpty && found.typeSymbol.isAnonOrRefinementClass => val retyped = typed (tree.duplicate.clearType()) - val foundDecls = retyped.tpe.decls filter (sym => !sym.isConstructor && !sym.isSynthetic) + val foundDecls = retyped.tpe.decls filter (sym => !sym.isConstructor && !sym.isSynthetic && !sym.isErroneous) if (foundDecls.isEmpty || (found.typeSymbol eq NoSymbol)) found else { // The members arrive marked private, presumably because there was no @@ -212,7 +212,8 @@ trait ContextErrors { case _ => found } - assert(!foundType.isErroneous && !req.isErroneous, (foundType, req)) + assert(!foundType.isErroneous, s"AdaptTypeError - foundType is Erroneous: $foundType") + assert(!req.isErroneous, s"AdaptTypeError - req is Erroneous: $req") issueNormalTypeError(callee, withAddendum(callee.pos)(typeErrorMsg(foundType, req))) infer.explainTypes(foundType, req) |