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.
34 lines
516 B
Kotlin
Vendored
34 lines
516 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
// FILE: A.java
|
|
public class A {
|
|
int foo() {return 1;}
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
fun foo() = ""
|
|
|
|
open class B: A() {
|
|
init {
|
|
val a: Int = <!DEBUG_INFO_LEAKING_THIS!>foo<!>()
|
|
}
|
|
}
|
|
|
|
fun test() {
|
|
fun foo() = ""
|
|
|
|
class B: A() {
|
|
init {
|
|
val a: Int = <!TYPE_MISMATCH!>foo()<!> // todo
|
|
}
|
|
}
|
|
}
|
|
|
|
class E: A() {
|
|
fun <!VIRTUAL_MEMBER_HIDDEN!>foo<!>() = A()
|
|
|
|
init {
|
|
val a: A = foo() // todo: discuss
|
|
}
|
|
} |