diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-05-25 22:57:33 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-10-23 14:23:08 +0200 |
commit | ce74bb00603f23087fbd3b0fe2870f09d73bb676 (patch) | |
tree | 0ac33983fb5d23cd85d4fbe08d67654257cc72a3 /src | |
parent | e6a5e692f58892dcf080fb3fe4fc4f8100e63301 (diff) | |
download | scala-ce74bb00603f23087fbd3b0fe2870f09d73bb676.tar.gz scala-ce74bb00603f23087fbd3b0fe2870f09d73bb676.tar.bz2 scala-ce74bb00603f23087fbd3b0fe2870f09d73bb676.zip |
[nomaster] SI-7519 Less brutal attribute resetting in adapt fallback
Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses
track of which enclosing class of the given name is referenced by
a `This` node which prefixes the an applied implicit view.
The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804
Cherry picked from 433880e91cba9e1e926e9fcbf04ecd4aeb1d73eb
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index e27f540a7d..48e7e3a38c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -876,8 +876,9 @@ trait Typers extends Modes with Adaptations with Tags { case SilentResultValue(result) => result case _ => - debuglog("fallback on implicits: " + tree + "/" + resetAllAttrs(original)) - val tree1 = typed(resetAllAttrs(original), mode, WildcardType) + val resetTree = resetLocalAttrs(original) + debuglog(s"fallback on implicits: ${tree}/$resetTree") + val tree1 = typed(resetTree, mode, WildcardType) // Q: `typed` already calls `pluginsTyped` and `adapt`. the only difference here is that // we pass `EmptyTree` as the `original`. intended? added in 2009 (53d98e7d42) by martin. tree1.tpe = pluginsTyped(tree1.tpe, this, tree1, mode, pt) |