summaryrefslogtreecommitdiff
path: root/test/files/pos/t3772.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-3772 Fix detection of term-owned companionsJason Zaugg2016-11-291-0/+8
Companion detection consults the scopes of enclosing Contexts during typechecking to avoid the cycles that would ensue if we had to look at into the info of enclosing class symbols. For example, this used to typecheck: object CC { val outer = 42 } if ("".isEmpty) { case class CC(c: Int) CC.outer } This logic was not suitably hardened to find companions in exactly the same nesting level. After fixing this problem, a similar problem in `Namer::inCurrentScope` could be solved to be more selective about synthesizing a companion object. In particular, if a manually defined companion trails after the case class, don't create an addiotional synthetic comanpanion object.