Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jun 9, 2021
1 parent c965315 commit 629f57c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/init/neg/i12544.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
enum Enum:
case Case
case Case2(x: Int)

def g(b: Enum.B): Int = b.foo()

object Enum:
object nested:
val a: Enum = Case

val b: Enum = f(nested.a)

def f(e: Enum): Enum = e

class B() { def foo() = n + 1 }
g(new B()) // error
val n: Int = 10

@main def main(): Unit = println(Enum.b)

0 comments on commit 629f57c

Please sign in to comment.