FIR. Refactor smart-cast representation in FIR tree
Make smart-casts non-transparent expression without delegation to underlying FirQualifiedAccessExpression, as children delegation in fir tree has unclear semantics Remove two different kinds of tree nodes for smart-casts
This commit is contained in:
committed by
teamcity
parent
bc9db58b3c
commit
513af2dfbc
@@ -0,0 +1,25 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// FILE: Foo.java
|
||||
|
||||
public class Foo {
|
||||
public abstract static class Bar extends Foo {
|
||||
|
||||
}
|
||||
|
||||
public static class Buz extends Bar {
|
||||
public String str = "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Box.kt
|
||||
|
||||
class Box<out T : Foo>(val foo: T) {
|
||||
val str: String
|
||||
get() {
|
||||
var foo: Foo = foo
|
||||
if (foo is Foo.Buz) {
|
||||
return foo.str
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user