Skip to content

Commit

Permalink
Fix scala#10549: Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Apr 29, 2021
1 parent 9e0dc21 commit 9dfcfa9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/init/neg/i10549b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Wrap {
def qux[T](e: E[T]) = e.foo

abstract class E[+T] { def foo: T }
object E {
final val A: E[Nothing] = new E { def foo = ref }
val ref = qux(A) // error
}
}
7 changes: 7 additions & 0 deletions tests/init/pos/i10549a.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Wrap {
class E
object E {
final val A = new E {}
val $values = Array(A)
}
}

0 comments on commit 9dfcfa9

Please sign in to comment.