Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt
T
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00

18 lines
489 B
Kotlin
Vendored

class Foo(var x: Int?) {
init {
if (x != null) {
val y = x
// Error: x is not stable, Type(y) = Int?
x<!UNSAFE_CALL!>.<!>hashCode()
y<!UNSAFE_CALL!>.<!>hashCode()
if (y == x) {
// Still error
y<!UNSAFE_CALL!>.<!>hashCode()
}
if (x == null && y != x) {
// Still error
y<!UNSAFE_CALL!>.<!>hashCode()
}
}
}
}