[FIR DFA] Don't consider anonymous object as stable initializer to bind
#KT-43332 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
interface A
|
||||
interface B
|
||||
|
||||
fun foo(x: A) {}
|
||||
fun foo(x: B) {}
|
||||
|
||||
open class C : A, B
|
||||
|
||||
fun main(a: A) {
|
||||
foo(a)
|
||||
|
||||
val anonymousA: A = object : C() {}
|
||||
foo(anonymousA)
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
FILE: questionableSmartCast.kt
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface B : R|kotlin/Any| {
|
||||
}
|
||||
public final fun foo(x: R|A|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun foo(x: R|B|): R|kotlin/Unit| {
|
||||
}
|
||||
public open class C : R|A|, R|B| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final fun main(a: R|A|): R|kotlin/Unit| {
|
||||
R|/foo|(R|<local>/a|)
|
||||
lval anonymousA: R|A| = object : R|C| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|C|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
R|/foo|(R|<local>/anonymousA|)
|
||||
}
|
||||
Reference in New Issue
Block a user