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 b56b35e commit 468de59Copy full SHA for 468de59
tests/neg/illegal-depmeth.scala
@@ -0,0 +1,13 @@
1
+object Test {
2
+
3
+ class C { type T }
4
5
+ def f(x: C, y: x.T): x.T = y // ok
6
7
+ def g(y: x.T, x: C): x.T = y // error
8
9
+ def h(x: x.T) = ??? // error
10
11
+ def g(x: => C): x.T = ??? // error: x is not stable
12
13
+}
tests/pos/param-depmeth.scala
@@ -0,0 +1,15 @@
+ val c = new C { type T = String }
+ val c2 = c
+ f(c, "abc")
+ f(new C{ type T = String}, "abc")
+ val d: (C{ type T = String}) # T = "abc"
14
15
0 commit comments