From a525d371e10b2bb9b6a2228f67603aa318f97716 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 25 Oct 2012 08:00:16 +0200 Subject: SI-6562 Fix crash with class nested in @inline method e6b4204604 moved access widenings from ExplicitOuter to SuperAccessors to reflect them in pickled signatures so that the inliner can take advantage of them under separate compilation. The followup discussion [1] determined that this wasn't the right solution: while it enabled new separate compilation inlinings, it failed to widen access of outer pointers and hence prevented certain inlinings. A better solution was proposed: modify the inliner to know that access widening is guaranteed to have happened in ExplicitOuter for any field accessed by an @inline-d method body, rather than relying solely on the pickled types. But this hasn't happened yet. In the meantime 07f94297 / #1121 reinstated the access widening to SuperAccessors, but took a slightly different approach, using `Symbol#enclMethod` rather than `closestEnclMethod`. That deviation triggers SI-6562. This commit goes back to `closestEnclMethod`. [1] https://groups.google.com/forum/#!topic/scala-internals/iPkMCygzws4 --- test/files/pos/t6562.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/files/pos/t6562.scala (limited to 'test') diff --git a/test/files/pos/t6562.scala b/test/files/pos/t6562.scala new file mode 100644 index 0000000000..eec7aa5199 --- /dev/null +++ b/test/files/pos/t6562.scala @@ -0,0 +1,14 @@ +class Test { + + @inline + def foo { + def it = new {} + (_: Any) => it + } + + @inline + private def bar { + def it = new {} + (_: Any) => it + } +} -- cgit v1.2.3