-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIR DFA] Don't consider anonymous object as stable initializer to bind
#KT-43332 Fixed
- Loading branch information
Showing
8 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
compiler/fir/analysis-tests/testData/resolve/problems/questionableSmartCast.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 26 additions & 0 deletions
26
compiler/fir/analysis-tests/testData/resolve/problems/questionableSmartCast.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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|) | ||
} |
5 changes: 5 additions & 0 deletions
5
compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...alysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...ts/tests/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
compiler/testData/codegen/boxInline/suspend/stateMachine/objectInsideLambdas.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// IGNORE_BACKEND_FIR: JVM_IR | ||
// COMMON_COROUTINES_TEST | ||
// WITH_RUNTIME | ||
// WITH_COROUTINES | ||
|