Closed
Description
minimized code
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)
}
}
expectation
Should work but fails with
4 | val xs: IArray2[Int] = IArray2(1)
| ^^^^^^^^^^
| Found: Lib.IArray2[Int]
| Required: Lib.IArray2[Int]