We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ac256a commit 5715f78Copy full SHA for 5715f78
tests/pos/i2527.scala
@@ -0,0 +1,3 @@
1
+object Foo {
2
+ val f: Function0[Int]{ def apply(): Int } = () => 42
3
+}
tests/pos/i2527b.scala
@@ -0,0 +1,18 @@
+class Base
+
+object Test {
4
+// OK
5
+val widen = {
6
+ class Inner extends Base
7
+ val f: () => Inner = { () => new Inner }
8
+ f()
9
10
11
+// Crash
12
+val leak = {
13
14
+ val f: (() => Inner){ def apply(): Inner } = { () => new Inner }
15
16
17
18
0 commit comments