diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-12-04 22:45:46 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-12-04 23:19:51 +0100 |
commit | 289a8820943a99c1c105aedddef44fb27a2dafc6 (patch) | |
tree | 7c10756706ab7963cedae615e83d40c91ea34a2b /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | |
parent | fd57069a3a49de1757a518b573a0cd8cb98bbbd5 (diff) | |
download | scala-289a8820943a99c1c105aedddef44fb27a2dafc6.tar.gz scala-289a8820943a99c1c105aedddef44fb27a2dafc6.tar.bz2 scala-289a8820943a99c1c105aedddef44fb27a2dafc6.zip |
SI-5390 Detect forward reference of case class apply
Refchecks performs (among others) two tasks at once:
- detecting forward references
- translating `qual.Case(...)` to `new qual.Case(...)`
As is often the case with such multi-tasking tree traversals,
completion of one task precluded the other.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 78ec6508ed..15ac3d134f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1534,8 +1534,14 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans sym.name == nme.apply && isClassTypeAccessible(tree) - if (doTransform) + if (doTransform) { + tree foreach { + case i@Ident(_) => + enterReference(i.pos, i.symbol) // SI-5390 need to `enterReference` for `a` in `a.B()` + case _ => + } toConstructor(tree.pos, tree.tpe) + } else { ifNot tree |