Support smart cast for nullability in LHS of class literal
#KT-16291 Fixed
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// KT-16291 Smart cast doesn't work when getting class of instance
|
||||
|
||||
class Foo(val s: String) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other != null && other::class == this::class && s == (other as Foo).s
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return if (Foo("a") == Foo("a")) "OK" else "Fail"
|
||||
}
|
||||
Reference in New Issue
Block a user