Don't run contract-specific checks in propery scopes

^KT-45118 Fixed
This commit is contained in:
Victor Petukhov
2021-09-28 14:11:33 +03:00
parent b957831683
commit b5661ccabd
11 changed files with 64 additions and 9 deletions
+11
View File
@@ -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