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.
12 lines
295 B
Kotlin
Vendored
12 lines
295 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
package Hello
|
|
|
|
open class Base<T>
|
|
class StringBase : Base<String>()
|
|
|
|
class Client<T, X: Base<T>>(<!UNUSED_PARAMETER!>x<!>: X)
|
|
|
|
fun test() {
|
|
val c = Client(StringBase()) // Type inference fails here for T.
|
|
val <!UNUSED_VARIABLE!>i<!> : Int = <!TYPE_MISMATCH!>c<!>
|
|
} |