summaryrefslogtreecommitdiff
path: root/test/files/run/outertest.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-7246 Make $outer pointer elision Java awareJason Zaugg2013-03-231-8/+39
| | | | | | | | | | | | | | | | | | | | | | In e0853b3, a space-saving optimization elided the outer pointer of inner classes if the the (protected) outer pointer of the immediate parent class was guaranteed to point to the same instance. But, this check failed to account for Java parent classes, which don't follow the Scala scheme. This commit disables the optimization in that case. The original test case in e0853b3 was anemic, I've fleshed it out to: - test the presense or absense of $outer pointers with Java reflection - test the optimization works in the presense of aliased and annotated aliased types. (The former worked already, the latter required a change to the implementation.) - Test the negative case when the prefixes don't line up and the subclass in fact needs its own $outer. This patch is based on work by Euguene Vigdorchik with some additions by Jason Zaugg.
* Removes redundant outersMartin Odersky2012-07-201-0/+26
Widens the criterion when outer fields can be omitted. It used to be that sub- and superclass had to be enclosed by the same outer class. Only in that case was the outer field of the class omitted. We now omit if subclass is contained in an outer class that is itself a subclass of the superclasses outer class. See test case "outertest.scala" for an example.