diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-17 11:09:46 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-17 11:09:46 -0800 |
commit | 682dbfaf670ee22568a25ab15f61707e9942f764 (patch) | |
tree | 99ed8568386fdf7164d5766191fc8e6648e75875 /src | |
parent | 80bb7ec3687c8ac2f5fc848973d7ef101888ce2b (diff) | |
parent | bbf0eb28fae4d4312518aa25de062f2323a0098c (diff) | |
download | scala-682dbfaf670ee22568a25ab15f61707e9942f764.tar.gz scala-682dbfaf670ee22568a25ab15f61707e9942f764.tar.bz2 scala-682dbfaf670ee22568a25ab15f61707e9942f764.zip |
Merge pull request #1707 from retronym/ticket/5390
SI-5390 Detect forward reference of case class apply
Diffstat (limited to 'src')
-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 3e1d3fdcc4..9bd3aa8fe5 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1536,8 +1536,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 |