summaryrefslogtreecommitdiff
path: root/test/files/run/t9390d.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t9390d.scala')
-rw-r--r--test/files/run/t9390d.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t9390d.scala b/test/files/run/t9390d.scala
new file mode 100644
index 0000000000..3c5de3abf7
--- /dev/null
+++ b/test/files/run/t9390d.scala
@@ -0,0 +1,12 @@
+class C { // C is not serializable
+ def foo: () => Any = {
+ { () => class UseOuterInConstructor { C.this.toString }; new UseOuterInConstructor : Any}
+ }
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ val f = c.foo
+ f() // Doesn't NPE, as we didn't elide the outer instance in the constructor call.
+ }
+}