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/t4842a.check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/neg/t4842a.check (limited to 'test/files/neg/t4842a.check') diff --git a/test/files/neg/t4842a.check b/test/files/neg/t4842a.check new file mode 100644 index 0000000000..39d77bfc48 --- /dev/null +++ b/test/files/neg/t4842a.check @@ -0,0 +1,4 @@ +t4842a.scala:2: error: self constructor arguments cannot reference unconstructed `this` + def this(x: Int) = this(new { println(Foo.this)}) // error + ^ +one error found -- cgit v1.2.3