Files
kotlin-fork/nj2k/testData/inference/nullability/superMethod.kt
T
Ilya Kirillov 2bd5a1f196 New J2K: separate nullability inference from common one & nullability bug fixes
It will be needed for structure mutability inference

#KT-21467 fixed
#KT-32609 fixed
#KT-32572 fixed
#KT-24677 fixed
2019-07-25 14:34:35 +03:00

19 lines
425 B
Kotlin
Vendored

open class A () {
open fun foo(x: /*T0@*/Int?): /*T1@*/Int? {
if (x/*T0@Int*/ == null/*LIT*/);
return null/*NULL!!U*/
}
}
class B : A() {
override fun foo(x: /*T2@*/Int?): /*T3@*/Int? {
return 1/*LIT*/
}
}
//T0 := UPPER due to 'COMPARE_WITH_NULL'
//UPPER <: T1 due to 'RETURN'
//LOWER <: T3 due to 'RETURN'
//T1 := T3 due to 'SUPER_DECLARATION'
//T0 := T2 due to 'SUPER_DECLARATION'