From 27d73ee7a92d8dd10d4d0598a29d3a3657053995 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 28 Aug 2013 17:32:40 +0200 Subject: SI-7223 More finesse in setting INCONSTRUCTOR It's a clunky flag used to determine very early on whether we're in the self-call, super-call or early-init section. In SI-6666 / fd6125428, the check was improved to consider nesting. But, that caused this regression, as Function's haven't been translated to classes yet, so our check for enclosing non-term owners failed wrongly flagged definitins body of a anonymous function as INCONSTRUCTOR. With this patch, we correctly flag: class C extends D { // INCONSTRUCTOR () => { !INCONSTRUCTOR } // INCONSTRUCTOR } --- test/files/run/t7223.check | 1 + test/files/run/t7223.scala | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/files/run/t7223.check create mode 100644 test/files/run/t7223.scala (limited to 'test/files/run') diff --git a/test/files/run/t7223.check b/test/files/run/t7223.check new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/test/files/run/t7223.check @@ -0,0 +1 @@ +0 diff --git a/test/files/run/t7223.scala b/test/files/run/t7223.scala new file mode 100644 index 0000000000..a707e957df --- /dev/null +++ b/test/files/run/t7223.scala @@ -0,0 +1,11 @@ +class D(val a: () => Int => () => Any) { + a()(0)() +} + +object Crash extends D(() => { + (x: Int) => {() => { new { println(x.toString) } }} +}) + +object Test extends App { + Crash +} -- cgit v1.2.3