From cd9e03af8d61e7def5df2a0958de31ca0c163780 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 14 Mar 2013 12:50:52 +0400 Subject: SI-7246 Make $outer pointer elision Java aware 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. --- test/files/run/t7246.check | 1 + 1 file changed, 1 insertion(+) create mode 100755 test/files/run/t7246.check (limited to 'test/files/run/t7246.check') diff --git a/test/files/run/t7246.check b/test/files/run/t7246.check new file mode 100755 index 0000000000..ce01362503 --- /dev/null +++ b/test/files/run/t7246.check @@ -0,0 +1 @@ +hello -- cgit v1.2.3