diff --git a/analysis/analysis-api/testData/memberScopeByFqName/MutableList.txt b/analysis/analysis-api/testData/memberScopeByFqName/MutableList.txt index c46059d816e..5740a4e262f 100644 --- a/analysis/analysis-api/testData/memberScopeByFqName/MutableList.txt +++ b/analysis/analysis-api/testData/memberScopeByFqName/MutableList.txt @@ -461,8 +461,8 @@ KtFirFunctionSymbol: annotatedType: [] kotlin/Boolean annotationClassIds: [] annotations: [] - callableIdIfNonLocal: kotlin/collections/List.isEmpty - dispatchType: kotlin/collections/List + callableIdIfNonLocal: kotlin/collections/MutableList.isEmpty + dispatchType: kotlin/collections/MutableList hasStableParameterNames: true isExtension: false isExternal: false @@ -538,11 +538,11 @@ KtFirKotlinPropertySymbol: annotatedType: [] kotlin/Int annotationClassIds: [] annotations: [] - callableIdIfNonLocal: kotlin/collections/List.size - dispatchType: kotlin/collections/List - getter: KtFirPropertyGetterSymbol() + callableIdIfNonLocal: kotlin/collections/MutableList.size + dispatchType: kotlin/collections/MutableList + getter: null hasBackingField: false - hasGetter: true + hasGetter: false hasSetter: false initializer: null isConst: false diff --git a/analysis/analysis-api/testData/referenceResolve/forLoopIn/inBuiltIns/member.txt b/analysis/analysis-api/testData/referenceResolve/forLoopIn/inBuiltIns/member.txt index a2b37cacfbd..fdcd7a47249 100644 --- a/analysis/analysis-api/testData/referenceResolve/forLoopIn/inBuiltIns/member.txt +++ b/analysis/analysis-api/testData/referenceResolve/forLoopIn/inBuiltIns/member.txt @@ -1,4 +1,4 @@ Resolved to: -0: (in kotlin.collections.IntIterator) operator fun next(): kotlin.Int -1: (in kotlin.collections.Iterator) operator fun hasNext(): kotlin.Boolean -2: (in kotlin.ranges.IntProgression) open operator fun iterator(): kotlin.collections.IntIterator +0: (in kotlin.collections.IntIterator) abstract operator fun hasNext(): kotlin.Boolean +1: (in kotlin.collections.IntIterator) operator fun next(): kotlin.Int +2: (in kotlin.ranges.IntProgression) open operator fun iterator(): kotlin.collections.IntIterator \ No newline at end of file diff --git a/analysis/analysis-api/testData/referenceResolve/forLoopIn/inLibrary/extension.txt b/analysis/analysis-api/testData/referenceResolve/forLoopIn/inLibrary/extension.txt index 93a152edc20..a13df3fcc3e 100644 --- a/analysis/analysis-api/testData/referenceResolve/forLoopIn/inLibrary/extension.txt +++ b/analysis/analysis-api/testData/referenceResolve/forLoopIn/inLibrary/extension.txt @@ -1,4 +1,4 @@ Resolved to: -0: (in kotlin.collections.CharIterator) operator fun next(): kotlin.Char -1: (in kotlin.collections.Iterator) operator fun hasNext(): kotlin.Boolean -2: (in kotlin.text) operator fun kotlin.CharSequence.iterator(): kotlin.collections.CharIterator +0: (in kotlin.collections.CharIterator) abstract operator fun hasNext(): kotlin.Boolean +1: (in kotlin.collections.CharIterator) operator fun next(): kotlin.Char +2: (in kotlin.text) operator fun kotlin.CharSequence.iterator(): kotlin.collections.CharIterator \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt index 4a92a4b39b2..f21628b0c99 100644 --- a/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt @@ -2,6 +2,6 @@ KT element: KtForExpression FIR element: FirWhileLoopImpl FIR element rendered: -while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { +while(R|/|.R|SubstitutionOverride|()) { lval x: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() -} +} \ No newline at end of file diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index eec7c710c3c..92919bf79e8 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -596,6 +596,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/PropertyInitializers.kt"); } + @Test + @TestMetadata("protectedWithGenericsInDifferentPackage.kt") + public void testProtectedWithGenericsInDifferentPackage() throws Exception { + runTest("compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt"); + } + @Test @TestMetadata("publishedApi.kt") public void testPublishedApi() throws Exception { diff --git a/compiler/fir/analysis-tests/testData/resolve/bareTypes2.fir.txt b/compiler/fir/analysis-tests/testData/resolve/bareTypes2.fir.txt index 6fd8444cbe8..7b171cc79cf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/bareTypes2.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/bareTypes2.fir.txt @@ -18,10 +18,10 @@ FILE: bareTypes2.kt } public final fun test(x: R|A<*>|): R|kotlin/Unit| { - when ((R|/x| as? R|C|)?.{ $subj$.R|/A.field| }) { + when ((R|/x| as? R|C|)?.{ $subj$.R|SubstitutionOverride| }) { ($subj$ is R|kotlin/String|) -> { when () { - ==((R|/x| as? R|B<*>|)?.{ $subj$.R|/A.cond| }, Boolean(true)) -> { + ==((R|/x| as? R|B<*>|)?.{ $subj$.R|SubstitutionOverride| }, Boolean(true)) -> { R|/x|.R|/C.foo|() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot index 47c1368e802..324c5835f6b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot @@ -204,7 +204,7 @@ digraph complex_kt { color=blue 62 [label="Enter loop condition"]; 63 [label="Access variable R|/|"]; - 64 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 64 [label="Function call: R|/|.R|SubstitutionOverride|()"]; 65 [label="Exit loop condition"]; } subgraph cluster_23 { diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt index df39f7729ba..66278d30dbf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt @@ -27,7 +27,7 @@ FILE: complex.kt public final inline fun R|kotlin/collections/List<*>|.firstIsInstanceOrNull(): R|T?| { { lval : R|kotlin/collections/Iterator| = this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval element: R|kotlin/Any?| = R|/|.R|SubstitutionOverride|() when () { (R|/element| is R|T|) -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot index 86207d2676c..7531480d3c3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot @@ -133,7 +133,7 @@ digraph loops_kt { color=blue 45 [label="Enter loop condition"]; 46 [label="Access variable R|/|"]; - 47 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 47 [label="Function call: R|/|.R|SubstitutionOverride|()"]; 48 [label="Exit loop condition"]; } subgraph cluster_17 { diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt index ef3dcf8c917..bc838da0b35 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt @@ -16,7 +16,7 @@ FILE: loops.kt public final fun testFor(x: R|kotlin/Any?|): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() lval y: R|kotlin/Boolean| = (R|/x| is R|kotlin/String|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.fir.txt index fb0928ff993..1e0cdd91cfb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.fir.txt @@ -23,11 +23,11 @@ FILE: qualifiedSupertypeExtendedByOtherSupertype.kt } public final fun test(): R|kotlin/Unit| { - this@R|/Test|.super|>.R|/IBase.foo|() - this@R|/Test|.super|>.R|/IBase.bar|() - this@R|/Test|.super|>.R|/IDerived.foo|() - this@R|/Test|.super|>.R|/IBase.bar|() - this@R|/Test|.super|>.R|/IDerived.qux|() + this@R|/Test|.super|>.R|SubstitutionOverride|() + this@R|/Test|.super|>.R|SubstitutionOverride|() + this@R|/Test|.super|>.R|SubstitutionOverride|() + this@R|/Test|.super|>.R|SubstitutionOverride|() + this@R|/Test|.super|>.R|SubstitutionOverride|() } } @@ -37,13 +37,13 @@ FILE: qualifiedSupertypeExtendedByOtherSupertype.kt } public final fun test(): R|kotlin/Unit| { - this@R|/Test2|.super|>.R|/IBase.foo|() - this@R|/Test2|.super|>.R|/IBase.bar|() - this@R|/Test2|.super|>.R|/IBase.foo|() - this@R|/Test2|.super|>.R|/IBase.bar|() - this@R|/Test2|.super|>.R|/IDerived.foo|() - this@R|/Test2|.super|>.R|/IBase.bar|() - this@R|/Test2|.super|>.R|/IDerived.qux|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() + this@R|/Test2|.super|>.R|SubstitutionOverride|() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt index 21bcb76fb7d..07225b7b4a3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt @@ -22,7 +22,7 @@ FILE: enumValues.kt lval values: R|kotlin/Array| = Q|MyEnum|.R|/MyEnum.values|() { lval : R|kotlin/collections/Iterator| = R|/values|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval value: R|MyEnum| = R|/|.R|SubstitutionOverride|() R|/value|.R|/MyEnum.bar|() } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.fir.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.fir.txt index ff7bfcfc6f1..7de4c1de5ba 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.fir.txt @@ -5,7 +5,7 @@ FILE: test.kt } public final override fun getLookupString(): R|kotlin/String| { - ^getLookupString this@R|/MyDecorator|.R|/MyDecorator.delegate|.R|/LookupElement.lookupString| + ^getLookupString this@R|/MyDecorator|.R|/Decorator.delegate|.R|/LookupElement.lookupString| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.fir.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.fir.txt index 0a2914df604..2da02e883d9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.fir.txt @@ -30,6 +30,6 @@ FILE: importedReceiver.kt (Q|My|, String()).R|/My.bar|() Q|My|.R|/My.baz|() (Q|My|, Boolean(true)).R|/My.gau|() - Q|My|.R|/Your.wat|() + Q|My|.R|SubstitutionOverride|() (Q|My|, Boolean(false)).R|SubstitutionOverride|() } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt index 1a987f68c6c..f2261e3c428 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt @@ -68,7 +68,7 @@ FILE: CanBeValChecker.kt R|/a| = Int(1) { lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(10)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() R|kotlin/io/print|(R|/i|) } @@ -171,7 +171,7 @@ FILE: CanBeValChecker.kt lvar a: R|kotlin/String?| lval unused: R|kotlin/Int| = Int(0) when () { - ==(R|/args|.R|kotlin/Array.size|, Int(1)) -> { + ==(R|/args|.R|SubstitutionOverride|, Int(1)) -> { R|/a| = R|/args|.R|SubstitutionOverride|(Int(0)) } else -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt index 28083b90670..7d60a909c74 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt @@ -2,7 +2,7 @@ FILE: NoWarning.kt public final fun foo(): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() } @@ -19,7 +19,7 @@ FILE: NoWarning.kt public final fun backward(): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/ranges/downTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() } @@ -36,7 +36,7 @@ FILE: NoWarning.kt public final fun until(): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(2)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt index ae450a6b177..bf402f57d08 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt @@ -2,7 +2,7 @@ FILE: Warning.kt public final fun foo(): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() } @@ -19,7 +19,7 @@ FILE: Warning.kt public final fun backward(): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/downTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() } @@ -36,7 +36,7 @@ FILE: Warning.kt public final fun until(): R|kotlin/Unit| { { lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(1)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt index 4fd06d51c3d..de842724971 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt @@ -5,7 +5,7 @@ FILE: manyLocalVariables.kt lvar c: R|kotlin/Int| = Int(3) { lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() when () { ==(R|/a|, Int(2)) -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt b/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt index 157e3b4715a..c3b8eefeb2e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt @@ -10,7 +10,7 @@ FILE: fib.kt lvar prev: R|kotlin/Int| = Int(1) { lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(R|/n|).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() lval temp: R|kotlin/Int| = R|/current| R|/current| = R|/current|.R|kotlin/Int.plus|(R|/prev|) diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt b/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt index 27edc0f1ff3..74dfb3b3816 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt @@ -7,7 +7,7 @@ FILE: nestedExtensionFunctionType.kt public final fun test_1(a: R|A|, ys: R|kotlin/collections/List<@ExtensionFunctionType kotlin/Function1>|): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1>| = R|/ys|.R|SubstitutionOverride>|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval y: R|(A) -> kotlin/Unit| = R|/|.R|SubstitutionOverride kotlin/Unit|>|() R|/y|.R|SubstitutionOverride|(R|/a|) } @@ -18,7 +18,7 @@ FILE: nestedExtensionFunctionType.kt public final fun test_2(a: R|A|, vararg zs: R|kotlin/Array>|): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1>| = R|/zs|.R|SubstitutionOverride)>|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval z: R|(A) -> kotlin/Unit| = R|/|.R|SubstitutionOverride kotlin/Unit|>|() R|/z|.R|SubstitutionOverride|(R|/a|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.fir.txt b/compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.fir.txt index db6b0d16653..c44e2a17b6f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.fir.txt @@ -13,9 +13,9 @@ FILE: compilerPhase.kt } public final inline fun R|PhaserState|.downlevel(nlevels: R|kotlin/Int|, block: R|() -> R|): R|R| { - this@R|/downlevel|.R|/PhaserState.depth| = this@R|/downlevel|.R|/PhaserState.depth|.R|kotlin/Int.plus|(R|/nlevels|) + this@R|/downlevel|.R|SubstitutionOverride| = this@R|/downlevel|.R|SubstitutionOverride|.R|kotlin/Int.plus|(R|/nlevels|) lval result: R|R| = R|/block|.R|SubstitutionOverride|() - this@R|/downlevel|.R|/PhaserState.depth| = this@R|/downlevel|.R|/PhaserState.depth|.R|kotlin/Int.minus|(R|/nlevels|) + this@R|/downlevel|.R|SubstitutionOverride| = this@R|/downlevel|.R|SubstitutionOverride|.R|kotlin/Int.minus|(R|/nlevels|) ^downlevel R|/result| } public abstract interface CompilerPhase : R|kotlin/Any| { diff --git a/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.fir.txt b/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.fir.txt index 51a5f7e4cf3..fc62a3770b3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.fir.txt @@ -22,11 +22,11 @@ FILE: main.kt } public final fun main(d1: R|D1|, e1: R|E1|, d2: R|D2|, e2: R|E2|): R|kotlin/Unit| { - R|/d1|.R|/D1.foo| + R|/d1|.R|/KB.foo| R|/d1|.# R|/e1|.R|/E1.foo| R|/e1|.# - R|/d2|.R|/D2.foo| + R|/d2|.R|/KB.foo| R|/d2|.# R|/e2|.R|/E2.foo| R|/e2|.# diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot index 56fc7892772..32caefb2c78 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -54,7 +54,7 @@ digraph boundSmartcastsInBranches_kt { color=blue 18 [label="Enter loop condition"]; 19 [label="Access variable R|/|"]; - 20 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 20 [label="Function call: R|/|.R|SubstitutionOverride|()"]; 21 [label="Exit loop condition"]; } subgraph cluster_8 { @@ -84,7 +84,7 @@ digraph boundSmartcastsInBranches_kt { 35 [label="Enter block"]; 36 [label="Access variable R|/a|"]; 37 [label="Assignment: R|/goodA|"]; - 38 [label="Jump: continue@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] "]; + 38 [label="Jump: continue@@@[R|/|.R|SubstitutionOverride|()] "]; 39 [label="Stub" style="filled" fillcolor=gray]; 40 [label="Exit block" style="filled" fillcolor=gray]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt index 114d928377c..4e8860ea5f9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt @@ -12,12 +12,12 @@ FILE: boundSmartcastsInBranches.kt lvar goodA: R|A?| = Null(null) { lval : R|kotlin/collections/Iterator| = R|/list|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval a: R|A| = R|/|.R|SubstitutionOverride|() when () { ==(R|/goodA|, Null(null)) -> { R|/goodA| = R|/a| - continue@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] + continue@@@[R|/|.R|SubstitutionOverride|()] } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.dot index 4246d02c591..49dbe7a2b8a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.dot @@ -51,7 +51,7 @@ digraph implicitReceiverAsWhenSubject_kt { color=blue 23 [label="Enter block"]; 24 [label="Access variable this@R|/test_1|"]; - 25 [label="Access variable R|kotlin/collections/List.size|"]; + 25 [label="Access variable R|SubstitutionOverride|"]; 26 [label="Exit block"]; } 27 [label="Exit when branch result"]; @@ -59,7 +59,7 @@ digraph implicitReceiverAsWhenSubject_kt { } 29 [label="Jump: ^test_1 when (this@R|/test_1|) { ($subj$ is R|kotlin/collections/List<*>|) -> { - this@R|/test_1|.R|kotlin/collections/List.size| + this@R|/test_1|.R|SubstitutionOverride| } ($subj$ is R|kotlin/String|) -> { this@R|/test_1|.R|kotlin/String.length| @@ -159,9 +159,9 @@ digraph implicitReceiverAsWhenSubject_kt { color=blue 59 [label="Enter block"]; 60 [label="Access variable R|/x|"]; - 61 [label="Access variable R|kotlin/collections/List.size|"]; + 61 [label="Access variable R|SubstitutionOverride|"]; 62 [label="Access variable this@R|/test_2|"]; - 63 [label="Access variable R|kotlin/collections/List.size|"]; + 63 [label="Access variable R|SubstitutionOverride|"]; 64 [label="Exit block"]; } 65 [label="Exit when branch result"]; @@ -169,8 +169,8 @@ digraph implicitReceiverAsWhenSubject_kt { } 67 [label="Jump: ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) { ($subj$ is R|kotlin/collections/List<*>|) -> { - R|/x|.R|kotlin/collections/List.size| - this@R|/test_2|.R|kotlin/collections/List.size| + R|/x|.R|SubstitutionOverride| + this@R|/test_2|.R|SubstitutionOverride| } ($subj$ is R|kotlin/String|) -> { R|/x|.R|kotlin/String.length| diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.fir.txt index 36af96ef981..89521a6b68b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.fir.txt @@ -2,7 +2,7 @@ FILE: implicitReceiverAsWhenSubject.kt public final fun R|kotlin/Any|.test_1(): R|kotlin/Int| { ^test_1 when (this@R|/test_1|) { ($subj$ is R|kotlin/collections/List<*>|) -> { - this@R|/test_1|.R|kotlin/collections/List.size| + this@R|/test_1|.R|SubstitutionOverride| } ($subj$ is R|kotlin/String|) -> { this@R|/test_1|.R|kotlin/String.length| @@ -16,8 +16,8 @@ FILE: implicitReceiverAsWhenSubject.kt public final fun R|kotlin/Any|.test_2(): R|kotlin/Int| { ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) { ($subj$ is R|kotlin/collections/List<*>|) -> { - R|/x|.R|kotlin/collections/List.size| - this@R|/test_2|.R|kotlin/collections/List.size| + R|/x|.R|SubstitutionOverride| + this@R|/test_2|.R|SubstitutionOverride| } ($subj$ is R|kotlin/String|) -> { R|/x|.R|kotlin/String.length| diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot index 66c135f46ff..969d79aa24f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot @@ -547,7 +547,7 @@ digraph implicitReceivers_kt { subgraph cluster_52 { color=blue 202 [label="Enter block"]; - 203 [label="Access variable R|kotlin/collections/List.size|"]; + 203 [label="Access variable R|SubstitutionOverride|"]; 204 [label="Exit block"]; } 205 [label="Exit when branch result"]; @@ -555,7 +555,7 @@ digraph implicitReceivers_kt { } 207 [label="Jump: ^test_5 when () { (this@R|/test_5| is R|kotlin/collections/List<*>|) -> { - this@R|/test_5|.R|kotlin/collections/List.size| + this@R|/test_5|.R|SubstitutionOverride| } (this@R|/test_5| is R|kotlin/String|) -> { this@R|/test_5|.R|kotlin/String.length| @@ -612,7 +612,7 @@ digraph implicitReceivers_kt { 212 [label="Enter block"]; 213 [label="Access variable this@R|/test_6|"]; 214 [label="Type operator: (this@R|/test_6| as R|kotlin/collections/List<*>|)"]; - 215 [label="Access variable R|kotlin/collections/List.size|"]; + 215 [label="Access variable R|SubstitutionOverride|"]; 216 [label="Access variable this@R|/test_6|"]; 217 [label="Type operator: (this@R|/test_6| as R|kotlin/String|)"]; 218 [label="Access variable R|kotlin/String.length|"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.fir.txt index 9898cb3d074..2058fcd237c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.fir.txt @@ -100,7 +100,7 @@ FILE: implicitReceivers.kt public final fun R|kotlin/Any|.test_5(): R|kotlin/Int| { ^test_5 when () { (this@R|/test_5| is R|kotlin/collections/List<*>|) -> { - this@R|/test_5|.R|kotlin/collections/List.size| + this@R|/test_5|.R|SubstitutionOverride| } (this@R|/test_5| is R|kotlin/String|) -> { this@R|/test_5|.R|kotlin/String.length| @@ -113,7 +113,7 @@ FILE: implicitReceivers.kt } public final fun R|kotlin/Any|.test_6(): R|kotlin/Unit| { (this@R|/test_6| as R|kotlin/collections/List<*>|) - this@R|/test_6|.R|kotlin/collections/List.size| + this@R|/test_6|.R|SubstitutionOverride| (this@R|/test_6| as R|kotlin/String|) this@R|/test_6|.R|kotlin/String.length| } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot index 6b2e9ea5e89..c33a1005175 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot @@ -181,7 +181,7 @@ digraph smartcastToNothing_kt { color=blue 61 [label="Enter loop condition"]; 62 [label="Access variable R|/|"]; - 63 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 63 [label="Function call: R|/|.R|SubstitutionOverride|()"]; 64 [label="Exit loop condition"]; } subgraph cluster_19 { @@ -213,7 +213,7 @@ digraph smartcastToNothing_kt { subgraph cluster_23 { color=blue 82 [label="Enter block" style="filled" fillcolor=gray]; - 83 [label="Jump: break@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray]; + 83 [label="Jump: break@@@[R|/|.R|SubstitutionOverride|()] " style="filled" fillcolor=gray]; 84 [label="Stub" style="filled" fillcolor=gray]; 85 [label="Exit block" style="filled" fillcolor=gray]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt index 0203f55d12a..b6ebf394306 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt @@ -32,12 +32,12 @@ FILE: smartcastToNothing.kt lvar s: R|A?| = Null(null) { lval : R|kotlin/collections/Iterator| = R|/results|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval result: R|kotlin/Nothing| = R|/|.R|SubstitutionOverride|() R|/s| = R|/result| when () { R|/result|.# -> { - break@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] + break@@@[R|/|.R|SubstitutionOverride|()] } } diff --git a/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt b/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt index cec089770f6..6cdd83a1305 100644 --- a/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt @@ -11,7 +11,7 @@ FILE: varargInPrimaryConstructor.kt public final fun test_1(foo: R|Foo|): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator| = R|/foo|.R|/Foo.strings|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval s: R|kotlin/String| = R|/|.R|SubstitutionOverride|() R|/s|.R|kotlin/String.length| } @@ -22,7 +22,7 @@ FILE: varargInPrimaryConstructor.kt public final fun test_2(vararg strings: R|kotlin/Array|): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator| = R|/strings|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval s: R|kotlin/String| = R|/|.R|SubstitutionOverride|() R|/s|.R|kotlin/String.length| } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt index 9d05d6714c2..96041532173 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt @@ -20,7 +20,7 @@ FILE: components.kt public final fun foo(list: R|kotlin/collections/List|): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator| = R|/list|.R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval : R|D| = R|/|.R|SubstitutionOverride|() lval x: R|kotlin/Int| = R|/|.R|/D.component1|() lval y: R|kotlin/String| = R|/|.R|/D.component2|() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot index fe8d960eecd..bd0bf2598d3 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot @@ -143,7 +143,7 @@ digraph flow_kt { color=blue 64 [label="Enter loop condition"]; 65 [label="Access variable R|/|"]; - 66 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 66 [label="Function call: R|/|.R|SubstitutionOverride|()"]; 67 [label="Exit loop condition"]; } subgraph cluster_20 { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt index cbe5e4e0904..cf3c83109ad 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt @@ -28,7 +28,7 @@ FILE: flow.kt Boolean(true) -> { { lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(0)).R|kotlin/ranges/IntProgression.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() R|/x|.R|SubstitutionOverride|() } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt index 71ac03537bd..01e8f921f84 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt @@ -253,7 +253,7 @@ FILE: forLoopChecker.kt { lval : R|kotlin/collections/Iterator| = R|/range1|.R|/Range1.iterator|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|SubstitutionOverride|() } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt index 4917ccbdd8d..72788c22926 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt @@ -44,7 +44,7 @@ FILE: DeepCopyIrTree.kt this@R|/DeepCopyIrTreeWithSymbols|.R|/DeepCopyIrTreeWithSymbols.typeRemapper|.R|/withinScope|(this@R|/DeepCopyIrTreeWithSymbols.copyTypeParametersFrom|, = withinScope@fun (): R|kotlin/Unit| { { lval : R|kotlin/collections/Iterator>| = this@R|/DeepCopyIrTreeWithSymbols.copyTypeParametersFrom|.R|/IrTypeParametersContainer.typeParameters|.R|kotlin/collections/zip|(R|/other|.R|/IrTypeParametersContainer.typeParameters|).R|SubstitutionOverride>|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval : R|kotlin/Pair| = R|/|.R|SubstitutionOverride|>|() lval thisTypeParameter: R|IrTypeParameter| = R|/|.R|SubstitutionOverride|() lval otherTypeParameter: R|IrTypeParameter| = R|/|.R|SubstitutionOverride|() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt index ffbf0f06608..d5e7806daae 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt @@ -46,10 +46,10 @@ FILE: valueOfOrNull.kt public final inline fun |> valueOfOrNull(value: R|kotlin/String|): R|E?| { { lval : R|kotlin/collections/Iterator| = R|kotlin/enumValues|().R|SubstitutionOverride|>|() - while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { + while(R|/|.R|SubstitutionOverride|()) { lval enumValue: R|E| = R|/|.R|SubstitutionOverride|() when () { - ==(R|/enumValue|.R|kotlin/Enum.name|, R|/value|) -> { + ==(R|/enumValue|.R|SubstitutionOverride|, R|/value|) -> { ^valueOfOrNull R|/enumValue| } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 66c838c8d04..99c5e78de8a 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -596,6 +596,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/PropertyInitializers.kt"); } + @Test + @TestMetadata("protectedWithGenericsInDifferentPackage.kt") + public void testProtectedWithGenericsInDifferentPackage() throws Exception { + runTest("compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt"); + } + @Test @TestMetadata("publishedApi.kt") public void testPublishedApi() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 24327f137e8..aed86094699 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -596,6 +596,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/PropertyInitializers.kt"); } + @Test + @TestMetadata("protectedWithGenericsInDifferentPackage.kt") + public void testProtectedWithGenericsInDifferentPackage() throws Exception { + runTest("compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt"); + } + @Test @TestMetadata("publishedApi.kt") public void testPublishedApi() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt index 69d11f930c4..8f9b419458e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind.* import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability import org.jetbrains.kotlin.types.AbstractNullabilityChecker +import org.jetbrains.kotlin.types.TypeApproximatorConfiguration abstract class ResolutionStage { abstract suspend fun check(candidate: Candidate, callInfo: CallInfo, sink: CheckerSink, context: ResolutionContext) @@ -122,8 +123,14 @@ object CheckDispatchReceiver : ResolutionStage() { !explicitReceiverExpression.isStable && (isCandidateFromUnstableSmartcast || (isReceiverNullable && !explicitReceiverExpression.smartcastType.canBeNull)) ) { + val dispatchReceiverType = (candidate.symbol as? FirCallableSymbol<*>)?.dispatchReceiverType?.let { + context.session.inferenceComponents.approximator.approximateToSuperType( + it, + TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference + ) ?: it + } val targetType = - (candidate.symbol as? FirCallableSymbol<*>)?.dispatchReceiverType ?: explicitReceiverExpression.smartcastType.coneType + dispatchReceiverType ?: explicitReceiverExpression.smartcastType.coneType sink.yieldDiagnostic( UnstableSmartCast( explicitReceiverExpression, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt index 326e83d0012..be4f0bbfbfe 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Synthetics.kt @@ -9,8 +9,8 @@ import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction import org.jetbrains.kotlin.fir.declarations.getDeprecationsFromAccessors -import org.jetbrains.kotlin.fir.declarations.utils.isStatic import org.jetbrains.kotlin.fir.declarations.synthetic.buildSyntheticProperty +import org.jetbrains.kotlin.fir.declarations.utils.isStatic import org.jetbrains.kotlin.fir.scopes.* import org.jetbrains.kotlin.fir.symbols.SyntheticSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirAccessorSymbol @@ -105,7 +105,7 @@ class FirSyntheticPropertiesScope( } } - val classLookupTag = getterSymbol.dispatchReceiverClassOrNull() + val classLookupTag = getterSymbol.originalOrSelf().dispatchReceiverClassOrNull() val packageName = classLookupTag?.classId?.packageFqName ?: getterSymbol.callableId.packageName val className = classLookupTag?.classId?.relativeClassName diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt index 2091afcc5d7..e8ee2feb020 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt @@ -17,7 +17,9 @@ import org.jetbrains.kotlin.fir.originalForSubstitutionOverride import org.jetbrains.kotlin.fir.resolve.ScopeSessionKey import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor import org.jetbrains.kotlin.fir.resolve.substitution.chain -import org.jetbrains.kotlin.fir.scopes.* +import org.jetbrains.kotlin.fir.scopes.FakeOverrideSubstitution +import org.jetbrains.kotlin.fir.scopes.FirTypeScope +import org.jetbrains.kotlin.fir.scopes.ProcessorAction import org.jetbrains.kotlin.fir.symbols.ensureResolved import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.ConeClassLikeType @@ -77,7 +79,9 @@ class FirClassSubstitutionScope( val original = callableSymbol.originalForSubstitutionOverride?.takeIf { originalInCache(it) } ?: return useSiteMemberScope.processDirectOverriddenCallablesWithBaseScope(callableSymbol, processor) - if (!processor(original, useSiteMemberScope)) return ProcessorAction.STOP + if (original != callableSymbol) { + if (!processor(original, useSiteMemberScope)) return ProcessorAction.STOP + } return useSiteMemberScope.processDirectOverriddenCallablesWithBaseScope(original, processor) } @@ -120,14 +124,29 @@ class FirClassSubstitutionScope( val member = original.fir if (skipPrivateMembers && member.visibility == Visibilities.Private) return original - val (newTypeParameters, newReceiverType, newReturnType, newSubstitutor, fakeOverrideSubstitution) = createSubstitutedData(member) + val (newTypeParameters, newDispatchReceiverType, newReceiverType, newReturnType, newSubstitutor, fakeOverrideSubstitution) = createSubstitutedData( + member + ) val newParameterTypes = member.valueParameters.map { it.returnTypeRef.coneType.substitute(newSubstitutor) } - if (newReceiverType == null && newReturnType == null && newParameterTypes.all { it == null } && - newTypeParameters === member.typeParameters && fakeOverrideSubstitution == null + if (newReceiverType == null && + newReturnType == null && + newParameterTypes.all { it == null } && + newTypeParameters === member.typeParameters && + fakeOverrideSubstitution == null ) { + if (original.dispatchReceiverType?.substitute(substitutor) != null) { + return FirFakeOverrideGenerator.createSubstitutionOverrideFunction( + session, + member, + original, + newDispatchReceiverType ?: dispatchReceiverTypeForSubstitutedMembers, + derivedClassId = newOwnerClassId, + isExpect = makeExpect, + ) + } return original } @@ -140,7 +159,7 @@ class FirClassSubstitutionScope( session, member, original, - dispatchReceiverTypeForSubstitutedMembers, + newDispatchReceiverType ?: dispatchReceiverTypeForSubstitutedMembers, newReceiverType, newReturnType, newParameterTypes, @@ -155,7 +174,7 @@ class FirClassSubstitutionScope( if (substitutor == ConeSubstitutor.Empty) return original val constructor = original.fir - val (newTypeParameters, _, newReturnType, newSubstitutor, fakeOverrideSubstitution) = createSubstitutedData(constructor) + val (newTypeParameters, _, _, newReturnType, newSubstitutor, fakeOverrideSubstitution) = createSubstitutedData(constructor) val newParameterTypes = constructor.valueParameters.map { it.returnTypeRef.coneType.substitute(newSubstitutor) } @@ -176,11 +195,25 @@ class FirClassSubstitutionScope( val member = original.fir if (skipPrivateMembers && member.visibility == Visibilities.Private) return original - val (newTypeParameters, newReceiverType, newReturnType, _, fakeOverrideSubstitution) = createSubstitutedData(member) + val (newTypeParameters, newDispatchReceiverType, newReceiverType, newReturnType, _, fakeOverrideSubstitution) = createSubstitutedData( + member + ) - if (newReceiverType == null && newReturnType == null && - newTypeParameters === member.typeParameters && fakeOverrideSubstitution == null + if (newReceiverType == null && + newReturnType == null && + newTypeParameters === member.typeParameters && + fakeOverrideSubstitution == null ) { + if (original.dispatchReceiverType?.substitute(substitutor) != null) { + return FirFakeOverrideGenerator.createSubstitutionOverrideProperty( + session, + member, + original, + newDispatchReceiverType ?: dispatchReceiverTypeForSubstitutedMembers, + derivedClassId = newOwnerClassId, + isExpect = makeExpect, + ) + } return original } @@ -189,7 +222,7 @@ class FirClassSubstitutionScope( session, member, original, - dispatchReceiverTypeForSubstitutedMembers, + newDispatchReceiverType ?: dispatchReceiverTypeForSubstitutedMembers, newReceiverType, newReturnType, newTypeParameters as List, @@ -201,6 +234,7 @@ class FirClassSubstitutionScope( private data class SubstitutedData( val typeParameters: List, + val dispatchReceiverType: ConeKotlinType?, val receiverType: ConeKotlinType?, val returnType: ConeKotlinType?, val substitutor: ConeSubstitutor, @@ -218,11 +252,20 @@ class FirClassSubstitutionScope( val receiverType = member.receiverTypeRef?.coneType val newReceiverType = receiverType?.substitute(substitutor) + val newDispatchReceiverType = dispatchReceiverTypeForSubstitutedMembers.substitute(substitutor) + member.symbol.ensureResolved(FirResolvePhase.STATUS) val returnType = member.returnTypeRef.coneTypeSafe() val fakeOverrideSubstitution = runIf(returnType == null) { FakeOverrideSubstitution(substitutor, member.symbol) } val newReturnType = returnType?.substitute(substitutor) - return SubstitutedData(newTypeParameters, newReceiverType, newReturnType, substitutor, fakeOverrideSubstitution) + return SubstitutedData( + newTypeParameters, + newDispatchReceiverType, + newReceiverType, + newReturnType, + substitutor, + fakeOverrideSubstitution + ) } fun createSubstitutionOverrideField(original: FirFieldSymbol): FirFieldSymbol { @@ -255,7 +298,8 @@ class FirClassSubstitutionScope( it.returnTypeRef.coneType.substitute() }.orEmpty() - if (newReturnType == null && + if (original.dispatchReceiverType?.substitute(substitutor) == null && + newReturnType == null && newGetterParameterTypes.all { it == null } && newSetterParameterTypes.all { it == null } ) { @@ -266,7 +310,7 @@ class FirClassSubstitutionScope( session, member, original, - dispatchReceiverTypeForSubstitutedMembers, + substitutor.substituteOrSelf(dispatchReceiverTypeForSubstitutedMembers), newReturnType, newGetterParameterTypes, newSetterParameterTypes, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt index 97d6526c5a8..ed647fac8db 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt @@ -42,9 +42,11 @@ object FirFakeOverrideGenerator { isExpect: Boolean = baseFunction.isExpect, fakeOverrideSubstitution: FakeOverrideSubstitution? = null ): FirNamedFunctionSymbol { - val symbol = FirNamedFunctionSymbol( - CallableId(derivedClassId ?: baseSymbol.callableId.classId!!, baseFunction.name) - ) + val symbol = if (derivedClassId == null) { + FirNamedFunctionSymbol(baseSymbol.callableId) + } else { + FirNamedFunctionSymbol(CallableId(derivedClassId, baseFunction.name)) + } createSubstitutionOverrideFunction( symbol, session, baseFunction, newDispatchReceiverType, newReceiverType, newReturnType, newParameterTypes, newTypeParameters, isExpect, fakeOverrideSubstitution @@ -261,9 +263,11 @@ object FirFakeOverrideGenerator { isExpect: Boolean = baseProperty.isExpect, fakeOverrideSubstitution: FakeOverrideSubstitution? = null ): FirPropertySymbol { - val symbol = FirPropertySymbol( - CallableId(derivedClassId ?: baseSymbol.callableId.classId!!, baseProperty.name) - ) + val symbol = if (derivedClassId == null) { + FirPropertySymbol(baseSymbol.callableId) + } else { + FirPropertySymbol(CallableId(derivedClassId, baseProperty.name)) + } createCopyForFirProperty( symbol, baseProperty, session, FirDeclarationOrigin.SubstitutionOverride, isExpect, newDispatchReceiverType, newTypeParameters, newReceiverType, newReturnType, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt index 68dde4c5664..57e922522f9 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt @@ -174,16 +174,22 @@ class FirTypeIntersectionScope private constructor( } val baseMembers = mutableSetOf() - for ((unwrappedMember, scope) in unwrappedMemberSet) { + for ((member, scope) in this) { @Suppress("UNCHECKED_CAST") - if (unwrappedMember is FirNamedFunctionSymbol) { - scope.processOverriddenFunctions(unwrappedMember) { - baseMembers += it.fir.unwrapSubstitutionOverrides().symbol as S + if (member is FirNamedFunctionSymbol) { + scope.processOverriddenFunctions(member) { + val symbol = it.fir.unwrapSubstitutionOverrides().symbol + if (symbol != member.fir.unwrapSubstitutionOverrides().symbol) { + baseMembers += symbol as S + } ProcessorAction.NEXT } - } else if (unwrappedMember is FirPropertySymbol) { - scope.processOverriddenProperties(unwrappedMember) { - baseMembers += it.fir.unwrapSubstitutionOverrides().symbol as S + } else if (member is FirPropertySymbol) { + scope.processOverriddenProperties(member) { + val symbol = it.fir.unwrapSubstitutionOverrides().symbol + if (symbol != member.fir.unwrapSubstitutionOverrides().symbol) { + baseMembers += symbol as S + } ProcessorAction.NEXT } } diff --git a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.txt b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.txt index 04c32ac1984..66126afe3e0 100644 --- a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.txt +++ b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.fir.txt @@ -58,7 +58,7 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt $this: CONST Int type=kotlin.Int value=0 other: GET_VAR 'val x: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .test.localFunc' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:i type:kotlin.Int [val] @@ -78,7 +78,7 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt $this: CONST Int type=kotlin.Int value=0 other: GET_VAR 'val y: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_2: kotlin.collections.IntIterator [val] declared in .test.localFunc.' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:j type:kotlin.Int [val] diff --git a/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.fir.kt b/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.fir.kt new file mode 100644 index 00000000000..c9fd9028fd7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.fir.kt @@ -0,0 +1,41 @@ +// FILE: foo/Super.java +package foo + +public abstract class Super { + protected abstract String getName(); + protected abstract void setName(String s); + + protected abstract String getName2(); + protected abstract void setName2(String s); + + protected abstract void doSomething(); + protected abstract void doSomething2(); +} + +// FILE: bar/Sub.kt +package bar + +abstract class Sub: foo.Super() { + abstract override fun getName(): String + abstract override fun setName(s: String) + abstract override fun doSomething() +} + +// FILE: foo/test.kt +package foo + +fun test(s: bar.Sub) { + s.name + s.name = "" + s.name2 + s.name2 = "" + s.doSomething() + s.doSomething2() + val s2: Super = s + s2.name + s2.name = "" + s2.name2 + s2.name2 = "" + s2.doSomething() + s2.doSomething2() +} diff --git a/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt b/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt new file mode 100644 index 00000000000..7e404f7638b --- /dev/null +++ b/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt @@ -0,0 +1,41 @@ +// FILE: foo/Super.java +package foo + +public abstract class Super { + protected abstract String getName(); + protected abstract void setName(String s); + + protected abstract String getName2(); + protected abstract void setName2(String s); + + protected abstract void doSomething(); + protected abstract void doSomething2(); +} + +// FILE: bar/Sub.kt +package bar + +abstract class Sub: foo.Super() { + abstract override fun getName(): String + abstract override fun setName(s: String) + abstract override fun doSomething() +} + +// FILE: foo/test.kt +package foo + +fun test(s: bar.Sub) { + s.name + s.name = "" + s.name2 + s.name2 = "" + s.doSomething() + s.doSomething2() + val s2: Super = s + s2.name + s2.name = "" + s2.name2 + s2.name2 = "" + s2.doSomething() + s2.doSomething2() +} diff --git a/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.txt b/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.txt new file mode 100644 index 00000000000..f50110b959b --- /dev/null +++ b/compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.txt @@ -0,0 +1,35 @@ +package + +package bar { + + public abstract class Sub : foo.Super { + public constructor Sub() + protected abstract override /*1*/ fun doSomething(): kotlin.Unit + protected/*protected and package*/ abstract override /*1*/ /*fake_override*/ fun doSomething2(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected abstract override /*1*/ fun getName(): kotlin.String + protected/*protected and package*/ abstract override /*1*/ /*fake_override*/ fun getName2(): kotlin.String! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + protected abstract override /*1*/ fun setName(/*0*/ s: kotlin.String): kotlin.Unit + protected/*protected and package*/ abstract override /*1*/ /*fake_override*/ fun setName2(/*0*/ s: kotlin.String!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +package foo { + public fun test(/*0*/ s: bar.Sub): kotlin.Unit + + public abstract class Super { + public constructor Super() + protected/*protected and package*/ abstract fun doSomething(): kotlin.Unit + protected/*protected and package*/ abstract fun doSomething2(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected/*protected and package*/ abstract fun getName(): kotlin.String! + protected/*protected and package*/ abstract fun getName2(): kotlin.String! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + protected/*protected and package*/ abstract fun setName(/*0*/ s: kotlin.String!): kotlin.Unit + protected/*protected and package*/ abstract fun setName2(/*0*/ s: kotlin.String!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.txt index 65a0f77ef13..d20c61bb0e0 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.txt @@ -93,7 +93,7 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt $this: VALUE_PARAMETER name: type:.InlineMutableSet BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .InlineMutableSet' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.Set' type=kotlin.Int origin=GET_PROPERTY + CALL 'public abstract fun (): kotlin.Int [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Int origin=GET_PROPERTY $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.' type=.InlineMutableSet origin=null FUN name:contains visibility:public modality:FINAL <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean [operator] @@ -124,7 +124,7 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt $this: VALUE_PARAMETER name: type:.InlineMutableSet BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun isEmpty (): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Set' type=kotlin.Boolean origin=null + CALL 'public abstract fun isEmpty (): kotlin.Boolean [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.isEmpty' type=.InlineMutableSet origin=null FUN name:add visibility:public modality:FINAL <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt index 90088e6460b..13fe5ef5fe1 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt @@ -17,7 +17,7 @@ FILE fqName: fileName:/breakContinueInWhen.kt CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testBreakFor' type=kotlin.IntArray origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val] @@ -76,7 +76,7 @@ FILE fqName: fileName:/breakContinueInWhen.kt CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testContinueFor' type=kotlin.IntArray origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt index 8995a1da409..31e77c7589a 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt @@ -9,7 +9,7 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null $this: GET_VAR 'args: kotlin.IntArray [vararg] declared in .sum' type=kotlin.IntArray origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:arg type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/expressions/for.fir.txt b/compiler/testData/ir/irText/expressions/for.fir.txt index 14a0e2807fe..41b21b29fc7 100644 --- a/compiler/testData/ir/irText/expressions/for.fir.txt +++ b/compiler/testData/ir/irText/expressions/for.fir.txt @@ -63,7 +63,7 @@ FILE fqName: fileName:/for.kt $this: CONST Int type=kotlin.Int value=1 other: CONST Int type=kotlin.Int value=10 WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:i type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/expressions/kt47245.fir.txt b/compiler/testData/ir/irText/expressions/kt47245.fir.txt index 089b59933ce..415ebb77139 100644 --- a/compiler/testData/ir/irText/expressions/kt47245.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt47245.fir.txt @@ -8,7 +8,7 @@ FILE fqName: fileName:/kt47245.kt $this: CONST Int type=kotlin.Int value=0 other: CONST Int type=kotlin.Int value=0 WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .test' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:i type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt index 9caf169c659..32f92c81ed4 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt @@ -82,7 +82,7 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: CALL 'public final fun (): T of .Outer declared in .Outer' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Outer declared in .test' type=.Outer origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Outer.Inner' type=kotlin.Int origin=GET_PROPERTY + other: CALL 'public final fun (): kotlin.Int [fake_override] declared in .test.' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .test. declared in .test.' type=.test. origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.test.) returnType:kotlin.Int correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.txt index c937cb8f572..789bdb2b04f 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.txt @@ -575,7 +575,7 @@ FILE fqName: fileName:/ArrayMap.kt arg1: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=GET_PROPERTY $this: CALL 'private final fun (): kotlin.Array declared in .ArrayMapImpl' type=kotlin.Array origin=GET_PROPERTY $this: GET_VAR ': .ArrayMapImpl.ArrayMapImpl> declared in .ArrayMapImpl.iterator' type=.ArrayMapImpl.ArrayMapImpl> origin=null - then: CALL 'protected final fun done (): kotlin.Unit declared in kotlin.collections.AbstractIterator' type=kotlin.Unit origin=null + then: CALL 'protected final fun done (): kotlin.Unit [fake_override] declared in .ArrayMapImpl.iterator.' type=kotlin.Unit origin=null $this: GET_VAR ': .ArrayMapImpl.iterator..ArrayMapImpl> declared in .ArrayMapImpl.iterator..computeNext' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.txt index 6e8058d81ce..1d823c21619 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.txt @@ -31,10 +31,9 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt FUN DELEGATED_MEMBER name:clear visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Unit overridden: public abstract fun clear (): kotlin.Unit [fake_override] declared in .Foo.A - public abstract fun clear (): kotlin.Unit [fake_override] declared in .Foo.B $this: VALUE_PARAMETER name: type:.Impl BLOCK_BODY - CALL 'public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet' type=kotlin.Unit origin=null + CALL 'public abstract fun clear (): kotlin.Unit [fake_override] declared in .Foo.B' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.clear' type=.Impl origin=null FUN DELEGATED_MEMBER name:iterator visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> [operator] @@ -104,26 +103,23 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt FUN DELEGATED_MEMBER name:isEmpty visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Boolean overridden: public abstract fun isEmpty (): kotlin.Boolean [fake_override] declared in .Foo.A - public abstract fun isEmpty (): kotlin.Boolean [fake_override] declared in .Foo.B $this: VALUE_PARAMETER name: type:.Impl BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in .Impl' - CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Set' type=kotlin.Boolean origin=null + CALL 'public abstract fun isEmpty (): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.isEmpty' type=.Impl origin=null PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] overridden: public abstract size: kotlin.Int [fake_override,val] - public abstract size: kotlin.Int [fake_override,val] FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Int correspondingProperty: PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] overridden: public abstract fun (): kotlin.Int [fake_override] declared in .Foo.A - public abstract fun (): kotlin.Int [fake_override] declared in .Foo.B $this: VALUE_PARAMETER name: type:.Impl BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Impl' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.Set' type=kotlin.Int origin=null + CALL 'public abstract fun (): kotlin.Int [fake_override] declared in .Foo.B' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.' type=.Impl origin=null FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final] diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.txt index 6fb9907f731..2977d2276bd 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.txt @@ -201,12 +201,11 @@ FILE fqName: fileName:/MultiList.kt public open fun contains (p0: @[FlexibleNullability] E of java.util.ArrayList?): kotlin.Boolean [operator] declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] .Some.SomeList>? - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List, elements:kotlin.collections.Collection<.Some.SomeList>>) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection, p0:kotlin.collections.Collection<@[FlexibleNullability] .Some.SomeList>?>) returnType:kotlin.Boolean [fake_override] overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection<.Some.MyList>>): kotlin.Boolean [fake_override] declared in .MyList public open fun containsAll (p0: kotlin.collections.Collection<@[FlexibleNullability] E of java.util.ArrayList?>): kotlin.Boolean [fake_override] declared in java.util.ArrayList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some.SomeList>> + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[FlexibleNullability] .Some.SomeList>?> FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[FlexibleNullability] .Some.SomeList>? [fake_override,operator] overridden: public open fun get (p0: kotlin.Int): @[FlexibleNullability] E of java.util.ArrayList? [operator] declared in java.util.ArrayList @@ -396,11 +395,11 @@ FILE fqName: fileName:/MultiList.kt public open fun contains (p0: @[FlexibleNullability] .Some.SomeList>?): kotlin.Boolean [fake_override,operator] declared in .SomeList $this: VALUE_PARAMETER name: type:java.util.ArrayList VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] .Some? - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:kotlin.collections.List, elements:kotlin.collections.Collection<.Some>) returnType:kotlin.Boolean [fake_override] + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection, p0:kotlin.collections.Collection<@[FlexibleNullability] .Some?>) returnType:kotlin.Boolean [fake_override] overridden: - public open fun containsAll (elements: kotlin.collections.Collection<.Some.SomeList>>): kotlin.Boolean [fake_override] declared in .SomeList - $this: VALUE_PARAMETER name: type:kotlin.collections.List - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.Some> + public open fun containsAll (p0: kotlin.collections.Collection<@[FlexibleNullability] .Some.SomeList>?>): kotlin.Boolean [fake_override] declared in .SomeList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[FlexibleNullability] .Some?> FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[FlexibleNullability] .Some? [fake_override,operator] overridden: public open fun get (p0: kotlin.Int): @[FlexibleNullability] .Some.SomeList>? [fake_override,operator] declared in .SomeList diff --git a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt index 5f9d4597642..781d3d6ed74 100644 --- a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt +++ b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt @@ -10,7 +10,7 @@ FILE fqName: fileName:/coercionInLoop.kt VAR name:i type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 WHILE label=null origin=WHILE_LOOP - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.DoubleIterator' type=kotlin.Boolean origin=null $this: GET_VAR 'val x: kotlin.collections.DoubleIterator [val] declared in .box' type=kotlin.collections.DoubleIterator origin=null body: BLOCK type=kotlin.Int origin=null WHEN type=kotlin.Unit origin=IF diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt index db4d9cf5c07..09e5fd3be62 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt @@ -9,7 +9,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[EnhancedNullability] .P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:x type:.P [val] @@ -23,7 +23,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[EnhancedNullability] .P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name: type:.P [val] @@ -43,7 +43,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=null $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? origin=null WHILE label=null origin=WHILE_LOOP - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=null $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[EnhancedNullability] .P> [val] declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:.P [val] @@ -73,7 +73,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=FOR_LOOP_ITERATOR $this: CALL 'public open fun listOfNotNull (): @[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? declared in .J' type=@[FlexibleNullability] kotlin.collections.List<@[EnhancedNullability] .P>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE - condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<@[EnhancedNullability] .P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<@[EnhancedNullability] .P> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:x type:.P [val] diff --git a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt index d1704b3bc74..7660e457490 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.fir.txt @@ -188,11 +188,11 @@ FILE fqName: fileName:/smartCastOnFakeOverrideReceiver.kt TYPE_OP type=.GB origin=CAST typeOperand=.GB GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun f (): kotlin.Int declared in .GA' type=kotlin.Int origin=null + CALL 'public final fun f (): kotlin.Int [fake_override] declared in .GB' type=kotlin.Int origin=null $this: TYPE_OP type=.GB origin=IMPLICIT_CAST typeOperand=.GB GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun (): kotlin.Int declared in .GA' type=kotlin.Int origin=GET_PROPERTY + CALL 'public final fun (): kotlin.Int [fake_override] declared in .GB' type=kotlin.Int origin=GET_PROPERTY $this: TYPE_OP type=.GB origin=IMPLICIT_CAST typeOperand=.GB GET_VAR 'a: kotlin.Any declared in .GB.testGB1' type=kotlin.Any origin=null FUN FAKE_OVERRIDE name:f visibility:public modality:FINAL <> ($this:.GA.GA>) returnType:kotlin.Int [fake_override] diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index e36b79ec086..e480d59ebcc 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -596,6 +596,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/PropertyInitializers.kt"); } + @Test + @TestMetadata("protectedWithGenericsInDifferentPackage.kt") + public void testProtectedWithGenericsInDifferentPackage() throws Exception { + runTest("compiler/testData/diagnostics/tests/protectedWithGenericsInDifferentPackage.kt"); + } + @Test @TestMetadata("publishedApi.kt") public void testPublishedApi() throws Exception {