[FIR] Create intersection overrides for fields in intersection type scope
^KT-56820 Fixed
This commit is contained in:
committed by
Space Team
parent
4e56079c59
commit
8c6d4a6f4b
+21
@@ -0,0 +1,21 @@
|
||||
FILE: main.kt
|
||||
private final val anyProperty: R|Property<kotlin/Any>| = R|/Property.Property|<R|kotlin/Any|>()
|
||||
private get(): R|Property<kotlin/Any>|
|
||||
private final val boundedProperty: R|Property<kotlin/String>| = R|/Property.Property|<R|kotlin/String|>()
|
||||
private get(): R|Property<kotlin/String>|
|
||||
public final fun test_1(x: R|Property<kotlin/Any>|): R|kotlin/Unit| {
|
||||
when () {
|
||||
(R|<local>/x| is R|Reference|) -> {
|
||||
R|<local>/x|.R|SubstitutionOverride</Reference.id>|
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test_2(x: R|Property<kotlin/String>|): R|kotlin/Unit| {
|
||||
when () {
|
||||
(R|<local>/x| is R|Reference|) -> {
|
||||
R|<local>/x|.R|/Reference.id|
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// ISSUE: KT-56820
|
||||
|
||||
// FILE: PropertyId.java
|
||||
public class PropertyId<T> {}
|
||||
|
||||
// FILE: ReferenceId.java
|
||||
public class ReferenceId extends PropertyId<Object> {}
|
||||
|
||||
// FILE: Property.java
|
||||
public class Property<T> {
|
||||
public PropertyId<T> id = new PropertyId<>();
|
||||
}
|
||||
|
||||
// FILE: Reference.java
|
||||
public class Reference extends Property<Object> {
|
||||
public ReferenceId getId() { return new ReferenceId(); }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
private val anyProperty = Property<Any>()
|
||||
private val boundedProperty = Property<String>()
|
||||
|
||||
fun test_1(x: Property<Any>) {
|
||||
if (x is Reference) {
|
||||
x.id
|
||||
}
|
||||
}
|
||||
|
||||
fun test_2(x: Property<String>) {
|
||||
if (x is Reference) {
|
||||
x.id
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user