bcc8802014
Expression will be checked against expected type later. Theoretically, this is not very good, but it aligns with the old inference, plus it helps avoiding multiple type mismatch diagnostics.
16 lines
430 B
Kotlin
Vendored
16 lines
430 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
// !CHECK_TYPE
|
|
import java.util.ArrayList
|
|
|
|
class ListOfLists<T>(public val x : ArrayList<ArrayList<T>>)
|
|
|
|
fun main() {
|
|
val a : ArrayList<ArrayList<String>> = ArrayList()
|
|
val b : ListOfLists<String> = ListOfLists(a)
|
|
val c : ListOfLists<*> = b
|
|
val d : ArrayList<ArrayList<*>> = <!TYPE_MISMATCH!>c.x<!>
|
|
|
|
c.x checkType { _<ArrayList<out ArrayList<*>>>() }
|
|
}
|