diff --git a/tests/neg/i6854.scala b/tests/neg/i6854.scala new file mode 100644 index 000000000000..00e960bb670b --- /dev/null +++ b/tests/neg/i6854.scala @@ -0,0 +1,12 @@ +object Test { + import Lib._ + val xs: IArray2[Int] = IArray2(1) +} + +object Lib { + opaque type IArray2[+T] = Array[_ <: T] + + object IArray2 { + inline def apply(x: =>Int): IArray2[Int] = Array(x) // error + } +}