diff options
author | Paul Phillips <paulp@improving.org> | 2013-01-29 13:16:23 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-29 13:24:40 -0800 |
commit | 039b1cb1a5b8738bb3731035838d2fcaeb317d07 (patch) | |
tree | dc623fd163c0789431b4bf2ec0f8551c88f58acb /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | 0388a7cdb111f0dd6b86bc838ffe51de3df28b4c (diff) | |
download | scala-039b1cb1a5b8738bb3731035838d2fcaeb317d07.tar.gz scala-039b1cb1a5b8738bb3731035838d2fcaeb317d07.tar.bz2 scala-039b1cb1a5b8738bb3731035838d2fcaeb317d07.zip |
Changes many calls to normalize to dealiasWiden.
Calling normalize is very aggressive and is usually the wrong
thing. It is one of the leading contributors to non-determinism
in compiler outcomes (often of the form "I gave a debugging or
logging compiler option and it started/stopped working") and
should be used only in very specific circumstances.
Almost without exception, dealiasWiden is what you want; not
widen, not normalize. If possible I will remove normalize from
Type entirely, making it private to those areas of the compiler
which actually require it.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 7bbbcdf541..4e4513dcef 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -153,7 +153,7 @@ trait ContextErrors { // members present, then display along with the expected members. This is done here because // this is the last point where we still have access to the original tree, rather than just // the found/req types. - val foundType: Type = req.normalize match { + 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) |