[FIR] Fully expand the bounds of type parameters for canBeNull check
This is required because a not-null bound `Foo` can resolve to a `typealias Foo = Bar?` in which case we must return true. #KT-64645 Fixed
This commit is contained in:
committed by
Space Team
parent
438b2dd164
commit
1018ff280e
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
// DIAGNOSTICS: -DEBUG_INFO_SMARTCAST, -FINAL_UPPER_BOUND
|
||||
// ISSUE: KT-64645
|
||||
|
||||
class Box(val value: String)
|
||||
typealias NullableBox = Box?
|
||||
|
||||
fun <T : NullableBox> foo(x: T) {
|
||||
if (x != null) {
|
||||
x.value
|
||||
}
|
||||
}
|
||||
|
||||
fun foo2(x: NullableBox) {
|
||||
if (x != null) {
|
||||
x.value
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user