Don't run contract-specific checks in propery scopes
^KT-45118 Fixed
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
open class Foo(open val x: Boolean)
|
||||
|
||||
class Bar: Foo(false) {
|
||||
val y = "OK"
|
||||
}
|
||||
|
||||
fun contract(x: Foo) = x
|
||||
|
||||
val temp = if (true) contract(Bar()) else Bar()
|
||||
|
||||
fun box(): String = (temp as Bar).y
|
||||
Reference in New Issue
Block a user