We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c1f0a56 + ecf97e8 commit 09daa51Copy full SHA for 09daa51
tests/init/neg/i12544.scala
@@ -0,0 +1,19 @@
1
+enum Enum:
2
+ case Case
3
+ case Case2(x: Int)
4
+
5
+def g(b: Enum.B): Int = b.foo()
6
7
+object Enum:
8
+ object nested:
9
+ val a: Enum = Case
10
11
+ val b: Enum = f(nested.a)
12
13
+ def f(e: Enum): Enum = e
14
15
+ class B() { def foo() = n + 1 }
16
+ g(new B()) // error
17
+ val n: Int = 10
18
19
+@main def main(): Unit = println(Enum.b)
tests/init/pos/i12544.scala
@@ -0,0 +1,12 @@
0 commit comments