From 723b275d99d3a21a3d4dc9658289cdf554db383e Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 1 Jun 2020 16:05:17 +0300 Subject: [PATCH] FIR: Fix rendered fir and DFA graph test data after safe-calls refactoring ^KT-38444 In Progress --- .../resolve/arguments/lambdaInLambda.txt | 4 +- .../resolve/arguments/lambdaInLambda2.txt | 2 +- .../testData/resolve/bareTypes.txt | 2 +- .../resolve/cfg/initBlockAndInPlaceLambda.dot | 2 +- .../resolve/cfg/initBlockAndInPlaceLambda.txt | 4 +- .../testData/resolve/cfg/safeCalls.dot | 4 +- .../testData/resolve/cfg/safeCalls.txt | 4 +- .../testData/resolve/companionObjectCall.txt | 4 +- .../expresssions/genericDescriptor.txt | 2 +- .../expresssions/invoke/extensionSafeCall.txt | 2 +- .../expresssions/syntheticSmartCast.txt | 18 ++--- .../resolve/lambdaArgInScopeFunction.txt | 8 +-- .../resolve/problems/safeCallInvoke.txt | 4 +- .../boundSmartcasts/boundSmartcasts.txt | 4 +- .../boundSmartcasts/functionCallBound.dot | 4 +- .../boundSmartcasts/functionCallBound.txt | 2 +- .../smartcasts/controlStructures/elvis.txt | 2 +- .../smartcasts/controlStructures/returns.txt | 2 +- .../resolve/smartcasts/nullability.dot | 18 ++--- .../resolve/smartcasts/nullability.txt | 14 ++-- .../smartcasts/safeCalls/assignSafeCall.dot | 4 +- .../smartcasts/safeCalls/assignSafeCall.txt | 8 +-- .../safeCalls/safeCallAndEqualityToBool.dot | 8 +-- .../safeCalls/safeCallAndEqualityToBool.txt | 8 +-- .../smartcasts/safeCalls/safeCalls.dot | 70 ++++++++++--------- .../smartcasts/safeCalls/safeCalls.txt | 14 ++-- .../resolve/smartcasts/smartcastToNothing.dot | 2 +- .../resolve/smartcasts/smartcastToNothing.txt | 4 +- .../testData/resolve/whenAsReceiver.txt | 4 +- .../concurrentMapOfAliases.txt | 2 +- 30 files changed, 116 insertions(+), 114 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt index 02385227711..d0e14f7ad25 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt @@ -27,10 +27,10 @@ FILE: lambdaInLambda.kt R|/buildString|( = buildString@fun R|StringBuilder|.(): R|kotlin/Unit| { this@R|special/anonymous|.R|/insert|(R|/KDocTemplate.KDocTemplate|(), = insert@fun R|KDocTemplate|.(): R|kotlin/Unit| { this@R|special/anonymous|.R|/KDocTemplate.definition|( = definition@fun R|StringBuilder|.(): R|kotlin/Unit| { - ^ R|/ordinal|?.R|kotlin/let|( = let@fun (it: R|kotlin/Int|): R|kotlin/Unit| { + R|/ordinal|?.{ $subj$.R|kotlin/let|( = let@fun (it: R|kotlin/Int|): R|kotlin/Unit| { ^@let Unit } - ) + ) } } ) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.txt index 343b25ef0f1..3664f40461b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.txt @@ -8,7 +8,7 @@ FILE: main.kt } public final fun test(): R|kotlin/Unit| { lval processor: R|AdapterProcessor!, ft!>| = R|/AdapterProcessor.AdapterProcessor|!|, R|ft!|>(R|/Function|!|, R|PsiClass?|>( = Function@fun (method: R|PsiMethod?|): R|PsiClass?| { - ^ R|/method|?.R|/PsiMethod.containingClass| + ^ R|/method|?.{ $subj$.R|/PsiMethod.containingClass| } } )) } diff --git a/compiler/fir/analysis-tests/testData/resolve/bareTypes.txt b/compiler/fir/analysis-tests/testData/resolve/bareTypes.txt index e1ec7db4443..ff938aa3861 100644 --- a/compiler/fir/analysis-tests/testData/resolve/bareTypes.txt +++ b/compiler/fir/analysis-tests/testData/resolve/bareTypes.txt @@ -8,7 +8,7 @@ FILE: bareTypes.kt public abstract interface MutableString : R|MutableA| { } public final fun test(a: R|A|): R|kotlin/Unit| { - (R|/a| as? R|MutableA|)?.R|FakeOverride|(String()) + (R|/a| as? R|MutableA|)?.{ $subj$.R|FakeOverride|(String()) } (R|/a| as R|MutableA|).R|FakeOverride|(String()) } public final fun test2(a: R|A|): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot index 3c7343c9114..7e24859abde 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot @@ -62,7 +62,7 @@ digraph initBlockAndInPlaceLambda_kt { } 26 [label="Call arguments union" style="filled" fillcolor=yellow]; 24 [label="Postponed exit from lambda"]; - 25 [label="Function call: R|/a|.R|/A.b|?.R|kotlin/let|(...)"]; + 25 [label="Function call: $subj$.R|kotlin/let|(...)"]; 22 [label="Exit safe call"]; 27 [label="Variable declaration: lval c: R|C?|"]; 28 [label="Exit block"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.txt index 4917523019e..996d335ff9f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.txt @@ -12,10 +12,10 @@ FILE: initBlockAndInPlaceLambda.kt } init { - lval c: R|C?| = R|/a|.R|/A.b|?.R|kotlin/let|( = let@fun (it: R|B|): R|C| { + lval c: R|C?| = R|/a|.R|/A.b|?.{ $subj$.R|kotlin/let|( = let@fun (it: R|B|): R|C| { ^ R|/C.C|(R|/a|, R|/it|) } - ) + ) } } } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot index 4374fe4936b..d76cdefab62 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot @@ -62,10 +62,10 @@ digraph safeCalls_kt { 16 [label="Enter function test_1" style="filled" fillcolor=red]; 18 [label="Access variable R|/x|"]; 19 [label="Enter safe call"]; - 21 [label="Function call: R|/x|?.R|/A.foo|()"]; + 21 [label="Function call: $subj$.R|/A.foo|()"]; 20 [label="Exit safe call"]; 22 [label="Enter safe call"]; - 24 [label="Function call: R|/x|?.R|/A.foo|()?.R|/A.bar|()"]; + 24 [label="Function call: $subj$.R|/A.bar|()"]; 23 [label="Exit safe call"]; 17 [label="Exit function test_1" style="filled" fillcolor=red]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.txt index 0790a8f3ce6..4d467b4aa05 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.txt @@ -14,8 +14,8 @@ FILE: safeCalls.kt } public final fun test_1(x: R|A?|): R|kotlin/Unit| { - R|/x|?.R|/A.foo|()?.R|/A.bar|() + R|/x|?.{ $subj$.R|/A.foo|() }?.{ $subj$.R|/A.bar|() } } public final fun test_2(x: R|B?|): R|kotlin/Unit| { - R|/x|?.R|/B.foo|?.R|/B.bar| + R|/x|?.{ $subj$.R|/B.foo| }?.{ $subj$.R|/B.bar| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/companionObjectCall.txt b/compiler/fir/analysis-tests/testData/resolve/companionObjectCall.txt index 961e4d7401a..6a7b2292487 100644 --- a/compiler/fir/analysis-tests/testData/resolve/companionObjectCall.txt +++ b/compiler/fir/analysis-tests/testData/resolve/companionObjectCall.txt @@ -6,12 +6,12 @@ FILE: companionObjectCall.kt } public final fun case1(a: R|A?|): R|kotlin/Unit| { - lval test: R|kotlin/String?| = R|/a|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/String| { + lval test: R|kotlin/String?| = R|/a|?.{ $subj$.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/String| { Q|Case1|.R|/Case1.Companion.invoke|(R|/it|) Q|Case1|.R|/Case1.Companion.invoke|(R|/it|) ^ Q|Case1|.R|/Case1.Companion.invoke|(R|/A.A|()) } - ) + ) } Q|Case1|.R|/Case1.Companion.invoke|(R|/A.A|()) Q|Case1|.R|/Case1.Companion.invoke|(a = R|/A.A|()) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.txt index c7646d1e673..f72a1162468 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.txt @@ -16,7 +16,7 @@ FILE: test.kt R|/resolvedCall|.R|/ResolvedCall.resultingDescriptor|.R|/name| lval resolvedDescriptor: R|D?| = R|/resolvedCall|.R|/ResolvedCall.candidateDescriptor| when () { - !=(R|/resolvedDescriptor|?.R|/correct|(), Boolean(true)) -> { + !=(R|/resolvedDescriptor|?.{ $subj$.R|/correct|() }, Boolean(true)) -> { ^test Unit } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.txt index acb04e5d86e..0a5eb0499b1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.txt @@ -1,5 +1,5 @@ FILE: extensionSafeCall.kt public final fun bar(doIt: R|kotlin/Int.() -> kotlin/Int|): R|kotlin/Unit| { lval i: R|kotlin/Int?| = Int(1) - R|/i|?.#() + R|/i|?.{ R|/doIt|.R|FakeOverride|($subj$) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt index 4f7f7606cb0..40a02dfeb38 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt @@ -16,7 +16,7 @@ FILE: test.kt } public final fun test1(x: R|AnotherClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/CharSequence| = when (lval : R|kotlin/CharSequence?| = R|/x|?.R|/AnotherClass.bar|) { + lval bar: R|kotlin/CharSequence| = when (lval : R|kotlin/CharSequence?| = R|/x|?.{ $subj$.R|/AnotherClass.bar| }) { ==($subj$, Null(null)) -> { ^test1 Unit } @@ -28,7 +28,7 @@ FILE: test.kt R|/x|.R|/AnotherClass.bar| } public final fun test2(x: R|SomeClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/CharSequence| = when (lval : R|kotlin/CharSequence?| = R|/x|?.R|/SomeClass.bar|) { + lval bar: R|kotlin/CharSequence| = when (lval : R|kotlin/CharSequence?| = R|/x|?.{ $subj$.R|/SomeClass.bar| }) { ==($subj$, Null(null)) -> { ^test2 Unit } @@ -40,7 +40,7 @@ FILE: test.kt R|/x|.R|/SomeClass.bar| } public final fun test3(x: R|AnotherClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/CharSequence?| = R|/x|?.R|/AnotherClass.bar| + lval bar: R|kotlin/CharSequence?| = R|/x|?.{ $subj$.R|/AnotherClass.bar| } when () { !=(R|/bar|, Null(null)) -> { R|/x|.R|/AnotherClass.bar|.R|kotlin/CharSequence.length| @@ -49,7 +49,7 @@ FILE: test.kt } public final fun test4(x: R|SomeClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/CharSequence?| = R|/x|?.R|/SomeClass.bar| + lval bar: R|kotlin/CharSequence?| = R|/x|?.{ $subj$.R|/SomeClass.bar| } when () { !=(R|/bar|, Null(null)) -> { R|/x|.R|/SomeClass.bar|.# @@ -58,7 +58,7 @@ FILE: test.kt } public final fun test5(x: R|AnotherClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/String| = when (lval : R|kotlin/String?| = (R|/x|?.R|/AnotherClass.bar| as? R|kotlin/String|)) { + lval bar: R|kotlin/String| = when (lval : R|kotlin/String?| = (R|/x|?.{ $subj$.R|/AnotherClass.bar| } as? R|kotlin/String|)) { ==($subj$, Null(null)) -> { ^test5 Unit } @@ -70,7 +70,7 @@ FILE: test.kt R|/x|.R|/AnotherClass.foo| } public final fun test6(x: R|SomeClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/String| = when (lval : R|kotlin/String?| = (R|/x|?.R|/SomeClass.bar| as? R|kotlin/String|)) { + lval bar: R|kotlin/String| = when (lval : R|kotlin/String?| = (R|/x|?.{ $subj$.R|/SomeClass.bar| } as? R|kotlin/String|)) { ==($subj$, Null(null)) -> { ^test6 Unit } @@ -82,7 +82,7 @@ FILE: test.kt R|/x|.R|/SomeClass.foo| } public final fun test7(x: R|AnotherClass?|): R|kotlin/Unit| { - lval baz: R|kotlin/Boolean| = when (lval : R|kotlin/Boolean?| = (R|/x|?.R|/AnotherClass.baz|() as? R|kotlin/Boolean|)) { + lval baz: R|kotlin/Boolean| = when (lval : R|kotlin/Boolean?| = (R|/x|?.{ $subj$.R|/AnotherClass.baz|() } as? R|kotlin/Boolean|)) { ==($subj$, Null(null)) -> { ^test7 Unit } @@ -94,7 +94,7 @@ FILE: test.kt R|/x|.R|/AnotherClass.foo| } public final fun test8(x: R|AnotherClass?|): R|kotlin/Unit| { - lval bar: R|kotlin/CharSequence| = when (lval : R|kotlin/CharSequence?| = R|/x|?.R|/AnotherClass.bar|) { + lval bar: R|kotlin/CharSequence| = when (lval : R|kotlin/CharSequence?| = R|/x|?.{ $subj$.R|/AnotherClass.bar| }) { ==($subj$, Null(null)) -> { ^test8 Unit } @@ -106,7 +106,7 @@ FILE: test.kt R|/x|.R|/AnotherClass.foo| } public final fun test9(x: R|AnotherClass?|): R|kotlin/Unit| { - lval baz: R|kotlin/Any| = when (lval : R|kotlin/Any?| = R|/x|?.R|/AnotherClass.baz|()) { + lval baz: R|kotlin/Any| = when (lval : R|kotlin/Any?| = R|/x|?.{ $subj$.R|/AnotherClass.baz|() }) { ==($subj$, Null(null)) -> { ^test9 Unit } diff --git a/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt b/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt index 82f56030f8a..21647b88521 100644 --- a/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt +++ b/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt @@ -13,21 +13,21 @@ FILE: lambdaArgInScopeFunction.kt } public final fun case1(kotlinClass: R|KotlinClass?|): R|kotlin/Unit| { - lval value: R|KotlinClass?| = R|/kotlinClass|?.R|kotlin/let|( = let@fun (it: R|KotlinClass|): R|KotlinClass| { + lval value: R|KotlinClass?| = R|/kotlinClass|?.{ $subj$.R|kotlin/let|( = let@fun (it: R|KotlinClass|): R|KotlinClass| { ^ R|/it| } - ) + ) } R|/value|.R|tests/_checkType/checkType|( = checkType@fun R|tests/_checkType/Inv|.(): R|kotlin/Unit| { this@R|special/anonymous|.R|tests/_checkType/_|() } ) - lval lambda: R|() -> KotlinClass| = R|/kotlinClass|?.R|kotlin/let| KotlinClass|>( = let@fun (it: R|KotlinClass|): R|() -> KotlinClass| { + lval lambda: R|() -> KotlinClass| = R|/kotlinClass|?.{ $subj$.R|kotlin/let| KotlinClass|>( = let@fun (it: R|KotlinClass|): R|() -> KotlinClass| { ^ let@fun (): R|KotlinClass| { ^ R|/it| } } - ) + ) } R|/lambda|.R|tests/_checkType/checkType| KotlinClass|>( = checkType@fun R|tests/_checkType/Inv?>|.(): R|kotlin/Unit| { ^ # KotlinClass?|>() } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.txt b/compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.txt index 1da15fd89b4..f9064f2d6aa 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.txt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.txt @@ -24,6 +24,6 @@ FILE: safeCallInvoke.kt } public final fun main(b: R|B?|): R|kotlin/Unit| { - R|/b|?.R|/B.bar|?.R|FakeOverride|() - R|/b|?.R|/B.foo|?.R|/A.invoke|() + R|/b|?.{ $subj$.R|/B.bar|.R|FakeOverride|() } + R|/b|?.{ $subj$.R|/B.foo|.R|/A.invoke|() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.txt index f0321386142..3a831b9363a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.txt @@ -92,8 +92,8 @@ FILE: boundSmartcasts.kt R|/d1|.R|/D.any|.R|/baz|() } public final fun test_7(d1: R|D|, d2: R|D|): R|kotlin/Unit| { - lval a: R|kotlin/Any?| = R|/d1|?.R|/D.any| - lval b: R|kotlin/Any?| = R|/d2|?.R|/D.any| + lval a: R|kotlin/Any?| = R|/d1|?.{ $subj$.R|/D.any| } + lval b: R|kotlin/Any?| = R|/d2|?.{ $subj$.R|/D.any| } (R|/a| as R|A|) R|/a|.R|/A.foo|() (R|/b| as R|B|) diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot index a9f0806d390..ae788eac039 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot @@ -76,7 +76,7 @@ digraph functionCallBound_kt { 25 [label="Access variable R|/base|"]; 26 [label="Type operator: (R|/base| as? R|Sub|)"]; 27 [label="Enter safe call"]; - 29 [label="Function call: (R|/base| as? R|Sub|)?.R|/isOk|()"]; + 29 [label="Function call: $subj$.R|/isOk|()"]; 28 [label="Exit safe call"]; 30 [label="Const: Boolean(true)"]; 31 [label="Operator =="]; @@ -107,7 +107,7 @@ digraph functionCallBound_kt { 23 [label="Exit when"]; } 46 [label="Jump: ^check when () { - ==((R|/base| as? R|Sub|)?.R|/isOk|(), Boolean(true)) -> { + ==((R|/base| as? R|Sub|)?.{ $subj$.R|/isOk|() }, Boolean(true)) -> { R|/base|.R|/Sub.data| } else -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.txt index 968bc4758ac..20492774326 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.txt @@ -19,7 +19,7 @@ FILE: functionCallBound.kt } public final fun check(base: R|Base|): R|Base| { ^check when () { - ==((R|/base| as? R|Sub|)?.R|/isOk|(), Boolean(true)) -> { + ==((R|/base| as? R|Sub|)?.{ $subj$.R|/isOk|() }, Boolean(true)) -> { R|/base|.R|/Sub.data| } else -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.txt index 4c54154713d..4b6c9aeb036 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.txt @@ -8,7 +8,7 @@ FILE: elvis.kt } public final fun test_1(x: R|A?|): R|kotlin/Unit| { when () { - when (lval : R|kotlin/Boolean?| = R|/x|?.R|/A.b|) { + when (lval : R|kotlin/Boolean?| = R|/x|?.{ $subj$.R|/A.b| }) { ==($subj$, Null(null)) -> { ^test_1 Unit } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.txt index 2f091f5ef73..f97e358abbe 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.txt @@ -74,7 +74,7 @@ FILE: returns.kt } public final fun test_4(a: R|kotlin/Any?|): R|kotlin/Unit| { lval s: R|kotlin/String?| = (R|/a| as? R|kotlin/String|) - lval length: R|kotlin/Int| = when (lval : R|kotlin/Int?| = R|/s|?.R|/ext|) { + lval length: R|kotlin/Int| = when (lval : R|kotlin/Int?| = R|/s|?.{ $subj$.R|/ext| }) { ==($subj$, Null(null)) -> { ^test_4 Unit } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot index cde0f1f870f..54ba56a576a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot @@ -440,7 +440,7 @@ digraph nullability_kt { 150 [label="Enter when branch condition "]; 151 [label="Access variable R|/x|"]; 152 [label="Enter safe call"]; - 154 [label="Function call: R|/x|?.R|/A.getA|()"]; + 154 [label="Function call: $subj$.R|/A.getA|()"]; 153 [label="Exit safe call"]; 155 [label="Const: Null(null)"]; 156 [label="Operator =="]; @@ -501,7 +501,7 @@ digraph nullability_kt { 178 [label="Access variable R|/MyData.s|"]; 177 [label="Exit safe call"]; 179 [label="Enter safe call"]; - 181 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 181 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; 180 [label="Exit safe call"]; 182 [label="Const: Null(null)"]; 183 [label="Operator !="]; @@ -574,7 +574,7 @@ digraph nullability_kt { 209 [label="Access variable R|/MyData.s|"]; 208 [label="Exit safe call"]; 210 [label="Enter safe call"]; - 212 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 212 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; 211 [label="Exit safe call"]; 213 [label="Variable declaration: lval : R|kotlin/Int?|"]; subgraph cluster_55 { @@ -672,13 +672,13 @@ digraph nullability_kt { 244 [label="Enter when branch condition "]; 245 [label="Access variable R|/q|"]; 246 [label="Enter safe call"]; - 248 [label="Function call: R|/q|?.R|/Q.fdata|()"]; + 248 [label="Function call: $subj$.R|/Q.fdata|()"]; 247 [label="Exit safe call"]; 249 [label="Enter safe call"]; - 251 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()"]; + 251 [label="Function call: $subj$.R|/MyData.fs|()"]; 250 [label="Exit safe call"]; 252 [label="Enter safe call"]; - 254 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()?.R|kotlin/Int.inc|()"]; + 254 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; 253 [label="Exit safe call"]; 255 [label="Const: Null(null)"]; 256 [label="Operator !="]; @@ -1140,7 +1140,7 @@ digraph nullability_kt { 431 [label="Access variable R|/MyData.s|"]; 430 [label="Exit safe call"]; 432 [label="Enter safe call"]; - 434 [label="Function call: R|/q|?.R|/QImpl.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 434 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; 433 [label="Exit safe call"]; 435 [label="Const: Null(null)"]; 436 [label="Operator !="]; @@ -1283,7 +1283,7 @@ digraph nullability_kt { 492 [label="Access variable R|/MyData.s|"]; 491 [label="Exit safe call"]; 493 [label="Enter safe call"]; - 495 [label="Function call: R|/q|?.R|/QImplWithCustomGetter.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 495 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; 494 [label="Exit safe call"]; 496 [label="Const: Null(null)"]; 497 [label="Operator !="]; @@ -1359,7 +1359,7 @@ digraph nullability_kt { 524 [label="Access variable R|/MyData.s|"]; 523 [label="Exit safe call"]; 525 [label="Enter safe call"]; - 527 [label="Function call: R|/q|?.R|/QImplMutable.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 527 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; 526 [label="Exit safe call"]; 528 [label="Const: Null(null)"]; 529 [label="Operator !="]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt index 006ed3b0566..5ffac85e437 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt @@ -99,7 +99,7 @@ FILE: nullability.kt } public final fun test_4(x: R|A?|): R|kotlin/Unit| { when () { - ==(R|/x|?.R|/A.getA|(), Null(null)) -> { + ==(R|/x|?.{ $subj$.R|/A.getA|() }, Null(null)) -> { ^test_4 Unit } } @@ -108,7 +108,7 @@ FILE: nullability.kt } public final fun test_5(q: R|Q?|): R|kotlin/Unit| { when () { - !=(R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|(), Null(null)) -> { + !=(R|/q|?.{ $subj$.R|/Q.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/Q.data| R|/q|.R|/Q.data|.# R|/q|.R|/Q.data|.#.#() @@ -117,7 +117,7 @@ FILE: nullability.kt } public final fun test_6(q: R|Q?|): R|kotlin/Unit| { - when (lval : R|kotlin/Int?| = R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()) { + when (lval : R|kotlin/Int?| = R|/q|?.{ $subj$.R|/Q.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }) { ==($subj$, Null(null)) -> { ^test_6 Unit } @@ -132,7 +132,7 @@ FILE: nullability.kt } public final fun test_7(q: R|Q?|): R|kotlin/Unit| { when () { - !=(R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()?.R|kotlin/Int.inc|(), Null(null)) -> { + !=(R|/q|?.{ $subj$.R|/Q.fdata|() }?.{ $subj$.R|/MyData.fs|() }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/Q.fdata|() R|/q|.R|/Q.fdata|().#() R|/q|.R|/Q.fdata|().#().#() @@ -210,7 +210,7 @@ FILE: nullability.kt } public final fun test_11(q: R|QImpl?|, q2: R|QImpl|): R|kotlin/Unit| { when () { - !=(R|/q|?.R|/QImpl.data|?.R|/MyData.s|?.R|kotlin/Int.inc|(), Null(null)) -> { + !=(R|/q|?.{ $subj$.R|/QImpl.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/QImpl.data| R|/q|.R|/QImpl.data|.R|/MyData.s| R|/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|() @@ -230,7 +230,7 @@ FILE: nullability.kt } public final fun test_12(q: R|QImplWithCustomGetter?|): R|kotlin/Unit| { when () { - !=(R|/q|?.R|/QImplWithCustomGetter.data|?.R|/MyData.s|?.R|kotlin/Int.inc|(), Null(null)) -> { + !=(R|/q|?.{ $subj$.R|/QImplWithCustomGetter.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/QImplWithCustomGetter.data| R|/q|.R|/QImplWithCustomGetter.data|.# R|/q|.R|/QImplWithCustomGetter.data|.#.#() @@ -240,7 +240,7 @@ FILE: nullability.kt } public final fun test_13(q: R|QImplMutable?|): R|kotlin/Unit| { when () { - !=(R|/q|?.R|/QImplMutable.data|?.R|/MyData.s|?.R|kotlin/Int.inc|(), Null(null)) -> { + !=(R|/q|?.{ $subj$.R|/QImplMutable.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/QImplMutable.data| R|/q|.R|/QImplMutable.data|.# R|/q|.R|/QImplMutable.data|.#.#() diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot index 1b7689c0651..0445d5076a6 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot @@ -114,7 +114,7 @@ digraph assignSafeCall_kt { 38 [label="Enter function test_2" style="filled" fillcolor=red]; 40 [label="Access variable R|/a|"]; 41 [label="Enter safe call"]; - 43 [label="Function call: R|/a|?.R|/A.foo|()"]; + 43 [label="Function call: $subj$.R|/A.foo|()"]; 42 [label="Exit safe call"]; 44 [label="Variable declaration: lval x: R|kotlin/Int?|"]; subgraph cluster_11 { @@ -333,7 +333,7 @@ digraph assignSafeCall_kt { 119 [label="Enter function test_2" style="filled" fillcolor=red]; 121 [label="Access variable R|/a|"]; 122 [label="Enter safe call"]; - 124 [label="Function call: R|/a|?.R|/B.foo|()"]; + 124 [label="Function call: $subj$.R|/B.foo|()"]; 123 [label="Exit safe call"]; 125 [label="Variable declaration: lval x: R|kotlin/Int?|"]; subgraph cluster_30 { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.txt index 2aa4fdd92c1..e148b9ffc44 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.txt @@ -16,7 +16,7 @@ FILE: assignSafeCall.kt } public final fun test_1(a: R|A?|): R|kotlin/Unit| { - lval x: R|kotlin/Int?| = R|/a|?.R|/A.x| + lval x: R|kotlin/Int?| = R|/a|?.{ $subj$.R|/A.x| } when () { !=(R|/x|, Null(null)) -> { R|/a|.R|/A.bar|() @@ -25,7 +25,7 @@ FILE: assignSafeCall.kt } public final fun test_2(a: R|A?|): R|kotlin/Unit| { - lval x: R|kotlin/Int?| = R|/a|?.R|/A.foo|() + lval x: R|kotlin/Int?| = R|/a|?.{ $subj$.R|/A.foo|() } when () { !=(R|/x|, Null(null)) -> { R|/a|.R|/A.bar|() @@ -56,7 +56,7 @@ FILE: assignSafeCall.kt } public final fun test_1(a: R|B?|): R|kotlin/Unit| { - lval x: R|kotlin/Int?| = R|/a|?.R|/B.x| + lval x: R|kotlin/Int?| = R|/a|?.{ $subj$.R|/B.x| } when () { !=(R|/x|, Null(null)) -> { R|/a|.R|/B.bar|() @@ -65,7 +65,7 @@ FILE: assignSafeCall.kt } public final fun test_2(a: R|B?|): R|kotlin/Unit| { - lval x: R|kotlin/Int?| = R|/a|?.R|/B.foo|() + lval x: R|kotlin/Int?| = R|/a|?.{ $subj$.R|/B.foo|() } when () { !=(R|/x|, Null(null)) -> { R|/a|.R|/B.bar|() diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot index c8288c38bc8..60a3b8e0800 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot @@ -28,7 +28,7 @@ digraph safeCallAndEqualityToBool_kt { 9 [label="Enter when branch condition "]; 10 [label="Access variable R|/s|"]; 11 [label="Enter safe call"]; - 13 [label="Function call: R|/s|?.R|/check|()"]; + 13 [label="Function call: $subj$.R|/check|()"]; 12 [label="Exit safe call"]; 14 [label="Const: Boolean(true)"]; 15 [label="Operator =="]; @@ -98,7 +98,7 @@ digraph safeCallAndEqualityToBool_kt { 35 [label="Enter when branch condition "]; 36 [label="Access variable R|/s|"]; 37 [label="Enter safe call"]; - 39 [label="Function call: R|/s|?.R|/check|()"]; + 39 [label="Function call: $subj$.R|/check|()"]; 38 [label="Exit safe call"]; 40 [label="Const: Boolean(false)"]; 41 [label="Operator =="]; @@ -168,7 +168,7 @@ digraph safeCallAndEqualityToBool_kt { 61 [label="Enter when branch condition "]; 62 [label="Access variable R|/s|"]; 63 [label="Enter safe call"]; - 65 [label="Function call: R|/s|?.R|/check|()"]; + 65 [label="Function call: $subj$.R|/check|()"]; 64 [label="Exit safe call"]; 66 [label="Const: Boolean(true)"]; 67 [label="Operator !="]; @@ -238,7 +238,7 @@ digraph safeCallAndEqualityToBool_kt { 87 [label="Enter when branch condition "]; 88 [label="Access variable R|/s|"]; 89 [label="Enter safe call"]; - 91 [label="Function call: R|/s|?.R|/check|()"]; + 91 [label="Function call: $subj$.R|/check|()"]; 90 [label="Exit safe call"]; 92 [label="Const: Boolean(false)"]; 93 [label="Operator !="]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt index 74e883c7d4b..cf740b26352 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt @@ -4,7 +4,7 @@ FILE: safeCallAndEqualityToBool.kt } public final fun test_1(s: R|kotlin/String?|): R|kotlin/Unit| { when () { - ==(R|/s|?.R|/check|(), Boolean(true)) -> { + ==(R|/s|?.{ $subj$.R|/check|() }, Boolean(true)) -> { R|/s|.R|kotlin/String.length| } else -> { @@ -15,7 +15,7 @@ FILE: safeCallAndEqualityToBool.kt } public final fun test_2(s: R|kotlin/String?|): R|kotlin/Unit| { when () { - ==(R|/s|?.R|/check|(), Boolean(false)) -> { + ==(R|/s|?.{ $subj$.R|/check|() }, Boolean(false)) -> { R|/s|.R|kotlin/String.length| } else -> { @@ -26,7 +26,7 @@ FILE: safeCallAndEqualityToBool.kt } public final fun test_3(s: R|kotlin/String?|): R|kotlin/Unit| { when () { - !=(R|/s|?.R|/check|(), Boolean(true)) -> { + !=(R|/s|?.{ $subj$.R|/check|() }, Boolean(true)) -> { R|/s|.# } else -> { @@ -37,7 +37,7 @@ FILE: safeCallAndEqualityToBool.kt } public final fun test_4(s: R|kotlin/String?|): R|kotlin/Unit| { when () { - !=(R|/s|?.R|/check|(), Boolean(false)) -> { + !=(R|/s|?.{ $subj$.R|/check|() }, Boolean(false)) -> { R|/s|.# } else -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot index 8a3a1e6a8bd..3b71bca5338 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot @@ -33,7 +33,7 @@ digraph safeCalls_kt { 13 [label="Access variable R|kotlin/String.length|"]; 14 [label="Const: Int(1)"]; 15 [label="Operator =="]; - 16 [label="Function call: R|/x|?.R|/foo|(...)"]; + 16 [label="Function call: $subj$.R|/foo|(...)"]; 11 [label="Exit safe call"]; 17 [label="Access variable R|/x|"]; 18 [label="Access variable #"]; @@ -86,7 +86,7 @@ digraph safeCalls_kt { 30 [label="Type operator: (R|/x| as? R|A|)"]; 31 [label="Enter safe call"]; 33 [label="Access variable R|/x|"]; - 34 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(...)"]; + 34 [label="Function call: $subj$.R|/A.bar|(...)"]; 32 [label="Exit safe call"]; 28 [label="Exit function test_2" style="filled" fillcolor=red]; } @@ -105,12 +105,12 @@ digraph safeCalls_kt { 38 [label="Type operator: (R|/x| as? R|A|)"]; 39 [label="Enter safe call"]; 41 [label="Access variable R|/x|"]; - 42 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(...)"]; + 42 [label="Function call: $subj$.R|/A.bar|(...)"]; 40 [label="Exit safe call"]; 43 [label="Enter safe call"]; 45 [label="Access variable R|/x|"]; 46 [label="Function call: R|/x|.R|/A.bool|()"]; - 47 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(...)?.R|/foo|(...)"]; + 47 [label="Function call: $subj$.R|/foo|(...)"]; 44 [label="Exit safe call"]; 48 [label="Enter safe call"]; 50 [label="Postponed enter to lambda"]; @@ -122,7 +122,7 @@ digraph safeCalls_kt { 56 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 51 [label="Postponed exit from lambda"]; - 52 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(...)?.R|/foo|(...)?.R|/let|(...)"]; + 52 [label="Function call: $subj$.R|/let|(...)"]; 49 [label="Exit safe call"]; 53 [label="Access variable R|/x|"]; 54 [label="Function call: R|/x|.#()"]; @@ -157,10 +157,10 @@ digraph safeCalls_kt { 59 [label="Enter function test_4" style="filled" fillcolor=red]; 61 [label="Access variable R|/x|"]; 62 [label="Enter safe call"]; - 64 [label="Function call: R|/x|?.R|/A.id|()"]; + 64 [label="Function call: $subj$.R|/A.id|()"]; 63 [label="Exit safe call"]; 65 [label="Enter safe call"]; - 67 [label="Function call: R|/x|?.R|/A.id|()?.R|/A.bool|()"]; + 67 [label="Function call: $subj$.R|/A.bool|()"]; 66 [label="Exit safe call"]; 68 [label="Access variable R|/x|"]; 69 [label="Function call: R|/x|.#()"]; @@ -192,45 +192,47 @@ digraph safeCalls_kt { 77 [label="Postponed enter to lambda"]; subgraph cluster_13 { color=blue - 88 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - 90 [label="Jump: ^test_5 Unit"]; - 91 [label="Stub" style="filled" fillcolor=gray]; - 89 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; + 89 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 91 [label="Jump: ^test_5 Unit"]; + 92 [label="Stub" style="filled" fillcolor=gray]; + 90 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; } 80 [label="Call arguments union" style="filled" fillcolor=gray]; 78 [label="Postponed exit from lambda"]; - 79 [label="Function call: R|/x|?.R|kotlin/let|(...)" style="filled" fillcolor=gray]; + 79 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=gray]; + 81 [label="Stub" style="filled" fillcolor=gray]; 76 [label="Exit safe call"]; - 81 [label="Enter safe call"]; - 83 [label="Access variable R|/x|"]; - 84 [label="Function call: R|/x|.R|/A.bool|()"]; - 85 [label="Function call: R|/x|?.R|kotlin/let|(...)?.R|/boo|(...)"]; - 82 [label="Exit safe call"]; - 86 [label="Access variable R|/x|"]; - 87 [label="Function call: R|/x|.#()"]; + 82 [label="Enter safe call"]; + 84 [label="Access variable R|/x|"]; + 85 [label="Function call: R|/x|.R|/A.bool|()"]; + 86 [label="Function call: $subj$.R|/boo|(...)"]; + 83 [label="Exit safe call"]; + 87 [label="Access variable R|/x|"]; + 88 [label="Function call: R|/x|.#()"]; 73 [label="Exit function test_5" style="filled" fillcolor=red]; } 72 -> {74}; 74 -> {75 76}; 75 -> {77}; - 76 -> {81 82}; - 77 -> {88}; + 76 -> {82 83}; + 77 -> {89}; 77 -> {78} [color=red]; 78 -> {79} [color=green]; - 79 -> {76} [style=dotted]; + 79 -> {73 81} [style=dotted]; 80 -> {79} [style=dotted]; - 81 -> {83}; - 82 -> {86}; - 83 -> {84}; + 81 -> {76} [style=dotted]; + 82 -> {84}; + 83 -> {87}; 84 -> {85}; - 85 -> {82}; - 86 -> {87}; - 87 -> {73}; - 88 -> {90}; - 89 -> {80} [style=dotted]; - 89 -> {78} [color=green]; - 90 -> {73}; - 90 -> {91} [style=dotted]; - 91 -> {89} [style=dotted]; + 85 -> {86}; + 86 -> {83}; + 87 -> {88}; + 88 -> {73} [style=dotted]; + 89 -> {91}; + 90 -> {80} [style=dotted]; + 90 -> {78} [color=green]; + 91 -> {73}; + 91 -> {92} [style=dotted]; + 92 -> {90} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt index f75efb6e9f1..c2cd2d924c1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt @@ -5,7 +5,7 @@ FILE: safeCalls.kt public final fun R|kotlin/String|.let(block: R|() -> kotlin/Unit|): R|kotlin/Unit| { } public final fun test(x: R|kotlin/String?|): R|kotlin/Unit| { - R|/x|?.R|/foo|(==(R|/x|.R|kotlin/String.length|, Int(1))) + R|/x|?.{ $subj$.R|/foo|(==(R|/x|.R|kotlin/String.length|, Int(1))) } R|/x|.# } public abstract interface A : R|kotlin/Any| { @@ -17,24 +17,24 @@ FILE: safeCalls.kt } public final fun test_2(x: R|kotlin/Any|): R|kotlin/Unit| { - (R|/x| as? R|A|)?.R|/A.bar|(R|/x|) + (R|/x| as? R|A|)?.{ $subj$.R|/A.bar|(R|/x|) } } public final fun test_3(x: R|kotlin/Any|): R|kotlin/Unit| { - (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)?.R|/foo|(R|/x|.R|/A.bool|())?.R|/let|( = let@fun (): R|kotlin/Unit| { + (R|/x| as? R|A|)?.{ $subj$.R|/A.bar|(R|/x|) }?.{ $subj$.R|/foo|(R|/x|.R|/A.bool|()) }?.{ $subj$.R|/let|( = let@fun (): R|kotlin/Unit| { ^ R|/x|.R|/A.bool|() } - ) + ) } R|/x|.#() } public final fun test_4(x: R|A?|): R|kotlin/Unit| { - R|/x|?.R|/A.id|()?.R|/A.bool|() + R|/x|?.{ $subj$.R|/A.id|() }?.{ $subj$.R|/A.bool|() } R|/x|.#() } public final fun R|kotlin/Any?|.boo(b: R|kotlin/Boolean|): R|kotlin/Unit| public final fun test_5(x: R|A?|): R|kotlin/Unit| { - R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Nothing| { + R|/x|?.{ $subj$.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Nothing| { ^test_5 Unit } - )?.R|/boo|(R|/x|.R|/A.bool|()) + ) }?.{ $subj$.R|/boo|(R|/x|.R|/A.bool|()) } R|/x|.#() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot index 560ba4d7c8f..b90bdf01d8d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot @@ -209,7 +209,7 @@ digraph smartcastToNothing_kt { } 91 [label="Call arguments union" style="filled" fillcolor=yellow]; 89 [label="Postponed exit from lambda"]; - 90 [label="Function call: R|/s|?.R|kotlin/let|(...)"]; + 90 [label="Function call: $subj$.R|kotlin/let|(...)"]; 87 [label="Exit safe call"]; 48 [label="Exit function test_0" style="filled" fillcolor=red]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.txt index d10c2d52df9..5e0fbe3650a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.txt @@ -42,8 +42,8 @@ FILE: smartcastToNothing.kt } - R|/s|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Int| { + R|/s|?.{ $subj$.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Int| { ^ R|/it|.R|/A.a| } - ) + ) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.txt b/compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.txt index 7d6d364ebf5..7071b7cf649 100644 --- a/compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.txt +++ b/compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.txt @@ -11,8 +11,8 @@ FILE: whenAsReceiver.kt Null(null) } } - ?.R|/also|( = also@fun (): R|kotlin/Int| { + ?.{ $subj$.R|/also|( = also@fun (): R|kotlin/Int| { ^ Int(1) } - ) + ) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/concurrentMapOfAliases.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/concurrentMapOfAliases.txt index 582aaa83eed..5b463950d0a 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/concurrentMapOfAliases.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/concurrentMapOfAliases.txt @@ -9,7 +9,7 @@ FILE: concurrentMapOfAliases.kt private get(): R|java/util/concurrent/ConcurrentHashMap!, ft!>| private final fun bar(): R|kotlin/Unit| { - (this@R|/A|, this@R|/A|.R|/A.foo|.R|FakeOverride|(String(dd)))?.R|/A.baz|() + this@R|/A|.R|/A.foo|.R|FakeOverride|(String(dd))?.{ (this@R|/A|, $subj$).R|/A.baz|() } } private final fun R|MyAlias|.baz(): R|kotlin/Unit| {