From 6aa5762fa0333625ec93378e2147649a8bafde34 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 17 Jun 2012 23:23:49 +0200 Subject: SI-4842 Forbid access to in-construction this in self-constructor args The check was already in place for direct calls to the super constructor. Without this additional check, ExplicitOuter crashes, as it doesn't create an $outer pointer for the constructor-arg scoped inner object, but expects one to exist when transforming the Outer.this reference. --- test/files/neg/t4842b.scala | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/files/neg/t4842b.scala (limited to 'test/files/neg/t4842b.scala') diff --git a/test/files/neg/t4842b.scala b/test/files/neg/t4842b.scala new file mode 100644 index 0000000000..a7996cc061 --- /dev/null +++ b/test/files/neg/t4842b.scala @@ -0,0 +1,3 @@ +class TypeArg[X](val x: X)(a: AnyRef) { + def this() = { this(???)(new { println(TypeArg.this.x) } ); println("next") } // error +} -- cgit v1.2.3