From 40a2837b4c0dd1cbb6f3b498236ad69106ebb88e Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 15 Nov 2021 11:30:57 +0300 Subject: [PATCH] FIR: Update test-data (Delegate inference) --- .../delegates/delegateInference.fir.txt | 4 +- .../delegateWithArgInference.fir.txt | 12 ++- .../delegates/delegateWithLambda.fir.txt | 8 +- .../resolve/delegates/delegateWithLambda.kt | 7 +- .../resolve/delegates/provideDelegate.fir.txt | 4 +- .../delegates/delegateTypeMismatch.fir.txt | 2 +- .../delegates/delegateWithAnonymousObject.dot | 25 +++--- .../delegateWithAnonymousObject.fir.txt | 2 +- .../delegates/kt41917.fir.txt | 4 +- .../propertyWithFunctionalType.fir.txt | 2 +- .../intellij/hideBySeverity.fir.txt | 6 +- ...tedGetSetPropertyDelegateConvention.fir.kt | 4 +- .../differentDelegatedExpressions.fir.kt | 8 +- .../inference/extensionProperty.kt | 4 +- .../genericMethodInGenericClass.fir.kt | 4 +- .../inference/genericMethods.fir.kt | 2 +- ...oExpectedTypeForSupertypeConstraint.fir.kt | 2 +- .../propertyDefferedType.fir.kt | 2 +- ...noOperatorModifierOnProvideDelegate.fir.kt | 2 +- ...ideDelegateOnFunctionalTypeWithThis.fir.kt | 2 +- .../provideDelegate/setValue.fir.kt | 2 +- .../unsupportedOperatorProvideDelegate.fir.kt | 2 +- .../typeMismatchForGetReturnType.fir.kt | 2 +- .../tests/typeParameters/kt42472.fir.kt | 2 +- .../ir/irText/expressions/kt47082.fir.ir.txt | 88 ------------------- .../ir/irText/expressions/kt47082.fir.kt.txt | 31 ------- .../testData/ir/irText/expressions/kt47082.kt | 1 + 27 files changed, 65 insertions(+), 169 deletions(-) delete mode 100644 compiler/testData/ir/irText/expressions/kt47082.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/expressions/kt47082.fir.kt.txt diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt index 03d12b5be37..8dd907e5aad 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt @@ -42,7 +42,7 @@ FILE: delegateInference.kt public final var x: R|kotlin/Boolean|by R|/FreezableVar.FreezableVar|(Boolean(true)) public get(): R|kotlin/Boolean| { - ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) + ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) } public set(: R|kotlin/Boolean|): R|kotlin/Unit| { this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|, R|/x|) @@ -50,7 +50,7 @@ FILE: delegateInference.kt public final var y: R|kotlin/String|by R|/FreezableVar.FreezableVar|(String()) public get(): R|kotlin/String| { - ^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|) + ^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|) } public set(: R|kotlin/String|): R|kotlin/Unit| { this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|, R|/y|) diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithArgInference.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithArgInference.fir.txt index 54a5637e627..83b57763b1c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithArgInference.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithArgInference.fir.txt @@ -15,13 +15,23 @@ FILE: delegateWithArgInference.kt public final fun makeIntDelegate(t: R|kotlin/Int|): R|Delegate| { ^makeIntDelegate R|/Delegate.Delegate|(R|/t|) } + public final fun makeDelegate(t: R|TT|): R|Delegate| { + ^makeDelegate R|/Delegate.Delegate|(R|/t|) + } public final fun materialize(): R|M| { ^materialize Null(null)!! } + public final fun materialize2(): R|M2| { + ^materialize2 Null(null)!! + } public final fun id(v: R|Q|): R|Q| { ^id R|/v| } - public final val x: R|kotlin/Int|by R|/makeIntDelegate|(R|/id|(R|/materialize|())) + public final val x: R|kotlin/Int|by R|/makeIntDelegate|(R|kotlin/run|( = run@fun (): R|kotlin/Int| { + lval x: R|kotlin/String| = R|/materialize|() + ^ R|/materialize2|() + } + )) public get(): R|kotlin/Int| { ^ D|/x|.R|SubstitutionOverride|(Null(null), ::R|/x|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt index a0133e4d9d2..52c036bc38c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt @@ -18,18 +18,20 @@ FILE: delegateWithLambda.kt public final fun getAny(): R|kotlin/Any?| { ^getAny Null(null) } + public final fun materialize(): R|Q| { + ^materialize Null(null)!! + } public final class Test : R|kotlin/Any| { public constructor(): R|Test| { super() } public final val x: R|kotlin/String|by R|/lazy|( = lazy@fun (): R|kotlin/String| { - lval y: R|kotlin/String| = (R|/getAny|() as? R|kotlin/String|) ?: String() - ^ R|/y| + ^ R|/materialize|() } ) public get(): R|kotlin/String| { - ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) + ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt index d704ff136e5..f8042235093 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt @@ -8,9 +8,10 @@ fun lazy(block: () -> T): LazyDelegate = LazyDelegate(block()) fun getAny(): Any? = null +fun materialize(): Q = null!! + class Test { - val x by lazy { - val y = getAny() as? String ?: "" - y + val x: String by lazy { + materialize() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt index a1eda8acb41..680a7dde0fe 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt @@ -38,9 +38,9 @@ FILE: provideDelegate.kt super() } - public final val x: R|kotlin/Int|by R|/delegate|(Int(1)).R|SubstitutionOverride|>|(this@R|/A|, ::R|/A.x|) + public final val x: R|kotlin/Int|by R|/delegate|(Int(1)).R|SubstitutionOverride|>|(this@R|/A|, ::R|/A.x|) public get(): R|kotlin/Int| { - ^ this@R|/A|.D|/A.x|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.x|) + ^ this@R|/A|.D|/A.x|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.x|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt index 008919b021f..d8be7b981c2 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt @@ -35,7 +35,7 @@ FILE: delegateTypeMismatch.kt public final var classifierNamePolicy: R|ClassifierNamePolicy|by this@R|/A|.R|/A.property|(Q|ClassifierNamePolicy.SOURCE_CODE_QUALIFIED|) public get(): R|ClassifierNamePolicy| { - ^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) + ^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) } public set(: R|ClassifierNamePolicy|): R|kotlin/Unit| { this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|/classifierNamePolicy|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index fef3d1dba69..0f496e532db 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -92,10 +92,10 @@ digraph delegateWithAnonymousObject_kt { 35 -> {36}; 36 -> {37}; - subgraph cluster_10 { + subgraph cluster_13 { color=red 38 [label="Enter function getValue" style="filled" fillcolor=red]; - subgraph cluster_11 { + subgraph cluster_14 { color=blue 39 [label="Enter block"]; 40 [label="Function call: R|/IssueListView.IssueListView|()"]; @@ -113,10 +113,10 @@ digraph delegateWithAnonymousObject_kt { 42 -> {43} [style=dotted]; 43 -> {44} [style=dotted]; - subgraph cluster_12 { + subgraph cluster_15 { color=red 45 [label="Enter function setValue" style="filled" fillcolor=red]; - subgraph cluster_13 { + subgraph cluster_16 { color=blue 46 [label="Enter block"]; 47 [label="Function call: R|/IssueListView.IssueListView|()"]; @@ -138,16 +138,16 @@ digraph delegateWithAnonymousObject_kt { 51 -> {52} [style=dotted]; 52 -> {53} [style=dotted]; - subgraph cluster_14 { + subgraph cluster_17 { color=red 54 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_15 { + subgraph cluster_18 { color=blue 55 [label="Enter block"]; 56 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 57 [label="Access variable this@R|/IssuesListUserProfile|"]; - 58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)"]; - 59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; + 58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)"]; + 59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; 60 [label="Stub" style="filled" fillcolor=gray]; 61 [label="Exit block" style="filled" fillcolor=gray]; } @@ -163,10 +163,10 @@ digraph delegateWithAnonymousObject_kt { 60 -> {61} [style=dotted]; 61 -> {62} [style=dotted]; - subgraph cluster_16 { + subgraph cluster_19 { color=red 63 [label="Enter function setter" style="filled" fillcolor=red]; - subgraph cluster_17 { + subgraph cluster_20 { color=blue 64 [label="Enter block"]; 65 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; @@ -185,7 +185,7 @@ digraph delegateWithAnonymousObject_kt { 68 -> {69}; 69 -> {70}; - subgraph cluster_18 { + subgraph cluster_21 { color=red 71 [label="Enter property" style="filled" fillcolor=red]; 72 [label="Postponed enter to lambda"]; @@ -217,7 +217,8 @@ digraph delegateWithAnonymousObject_kt { 80 [label="Exit property" style="filled" fillcolor=red]; } 70 -> {71}; - 71 -> {72} [color=red]; + 71 -> {72}; + 71 -> {26} [style=dashed]; 71 -> {72}; 72 -> {73}; 72 -> {} [style=dashed]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt index 332b46cb648..2d740534f34 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt @@ -41,7 +41,7 @@ FILE: delegateWithAnonymousObject.kt } ) public get(): R|IssueListView| { - ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) + ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) } public set(: R|IssueListView|): R|kotlin/Unit| { this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt index 5ec004ee783..1bd9fc90095 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt @@ -25,12 +25,12 @@ FILE: kt41917.kt public final val implicit: R|kotlin/String|by R|/DummyDelegate.DummyDelegate|(String(hello)) public get(): R|kotlin/String| { - ^ this@R|/A|.D|/A.implicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.implicit|) + ^ this@R|/A|.D|/A.implicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.implicit|) } public final val explicit: R|kotlin/String|by R|/DummyDelegate.DummyDelegate|(String(hello)) public get(): R|kotlin/String| { - ^ this@R|/A|.D|/A.explicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.explicit|) + ^ this@R|/A|.D|/A.explicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.explicit|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt index 8d67d71d770..0b633af3a4a 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt @@ -26,7 +26,7 @@ FILE: propertyWithFunctionalType.kt } ) public get(): R|(B) -> B| { - ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride B|>|(this@R|/A|, ::R|/A.conventerWithExpectedType|) + ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|) } public set(: R|(B) -> B|): R|kotlin/Unit| { this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|/conventerWithExpectedType|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt index 604cf0dfc7f..6098bc2af0e 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt @@ -30,14 +30,14 @@ FILE: hideBySeverity.kt super() } - public final val hideBySeverityDerived: R|kotlin/collections/MutableSet|by this@R|/Some|.R|/BaseState.propertyDerived||>(R|kotlin/collections/mutableSetOf|()).R|SubstitutionOverride>|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) + public final val hideBySeverityDerived: R|kotlin/collections/MutableSet|by this@R|/Some|.R|/BaseState.propertyDerived||>(R|kotlin/collections/mutableSetOf|()).R|SubstitutionOverride|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) public get(): R|kotlin/collections/MutableSet| { - ^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) + ^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) } public final val hideBySeverityBase: R|kotlin/collections/MutableSet|by this@R|/Some|.R|/BaseState.propertyBase||>(R|kotlin/collections/mutableSetOf|()) public get(): R|kotlin/collections/MutableSet| { - ^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride|>|(this@R|/Some|, ::R|/Some.hideBySeverityBase|) + ^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride|(this@R|/Some|, ::R|/Some.hideBySeverityBase|) } } diff --git a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt index 4faadf2095e..0c5f2270f56 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt @@ -33,8 +33,8 @@ operator fun CustomDelegate3.setValue(thisRef: Any?, prop: KProperty<*>, value: class Example { - var a by CustomDelegate() - val aval by CustomDelegate() + var a by CustomDelegate() + val aval by CustomDelegate() var b by OkDelegate() var c by CustomDelegate2() var d by CustomDelegate3() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt index 987cca15202..3dc5b0fb935 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt @@ -9,10 +9,10 @@ class A(outer: Outer) { var g: String by outer.getContainer().getMyProperty() - var b: String by foo(getMyProperty()) - var r: String by foo(outer.getContainer().getMyProperty()) - var e: String by + foo(getMyProperty()) - var f: String by foo(getMyProperty()) - 1 + var b: String by foo(getMyProperty()) + var r: String by foo(outer.getContainer().getMyProperty()) + var e: String by + foo(getMyProperty()) + var f: String by foo(getMyProperty()) - 1 } fun foo(a: Any?) = MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt index c6817731b4f..dc3d9e7c5ab 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt @@ -4,10 +4,10 @@ package foo import kotlin.reflect.KProperty open class A { - val B.w: Int by MyProperty() + val B.w: Int by MyProperty() } -val B.r: Int by MyProperty() +val B.r: Int by MyProperty() val A.e: Int by MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt index 3bba6c5ac33..47aaedbea0c 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt @@ -7,7 +7,7 @@ class A() { operator fun setValue(t: Any?, p: KProperty<*>, x: T) = Unit } -var a1: Int by A() +var a1: Int by A() var a2: Int by A() class B() { @@ -24,4 +24,4 @@ class C() { } var c1: Int by C() -var c2: Int by C() +var c2: Int by C() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt index 26d22b8721e..b2c23e6e69f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt @@ -3,7 +3,7 @@ import kotlin.reflect.KProperty var a: Int by A() -var a1 by A() +var a1 by A() var b: Int by B() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.fir.kt index 2329d6c5120..4fe8fd06191 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.fir.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty class A { - var a by MyProperty() + var a by MyProperty() } class MyProperty { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt index 44991d8b81f..d2f3400c99b 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty class B { - val c by Delegate(ag) + val c by Delegate(ag) } class Delegate(val init: T) { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.fir.kt index d896f77a2d4..b4c5584cbb1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.fir.kt @@ -12,5 +12,5 @@ fun String.provideDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this) operator fun String.getValue(a: Any?, p: KProperty<*>) = this val test1: String by "OK" -val test2: Int by "OK" +val test2: Int by "OK" val test3 by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt index f5f851ec4a7..deea7214238 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt @@ -13,7 +13,7 @@ fun wrong(arg: Wrong) {} class Wrong class Right { - val prop: () -> Unit by ::wrong + val prop: () -> Unit by ::wrong } fun box(): String { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.fir.kt index 5f274345629..923ce3053a9 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.fir.kt @@ -10,7 +10,7 @@ operator fun String.provideDelegate(receiver: Any?, p: Any) = Delegate() var test1: String by Delegate() var test2: String by Delegate() -var test3: String by "OK" +var test3: String by "OK" var test4: String by "OK".provideDelegate(null, "") var test5: String by "OK".provideDelegate(null, "") diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt index 093eca752ea..a18129f93a8 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt @@ -9,6 +9,6 @@ operator fun String.provideDelegate(thisRef: Any?, prop: Any) = WrongDelegate(th operator fun String.getValue(thisRef: Any?, prop: Any) = this -val test1: String by "OK" +val test1: String by "OK" val test2: Int by "OK" val test3 by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt index 0bc66c979b6..9f87631f031 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty -val c: Int by Delegate() +val c: Int by Delegate() class Delegate { operator fun getValue(t: Any?, p: KProperty<*>): String { diff --git a/compiler/testData/diagnostics/tests/typeParameters/kt42472.fir.kt b/compiler/testData/diagnostics/tests/typeParameters/kt42472.fir.kt index 1c05d53c7ae..00766fb7a93 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/kt42472.fir.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/kt42472.fir.kt @@ -7,6 +7,6 @@ fun interface ReadOnlyProperty { } class Problem { - val variable: Int by delegate() // delegate returns `ReadOnlyProperty` + val variable: Int by delegate() // delegate returns `ReadOnlyProperty` fun delegate() = null as ReadOnlyProperty } diff --git a/compiler/testData/ir/irText/expressions/kt47082.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt47082.fir.ir.txt deleted file mode 100644 index 3ef1b649c56..00000000000 --- a/compiler/testData/ir/irText/expressions/kt47082.fir.ir.txt +++ /dev/null @@ -1,88 +0,0 @@ -FILE fqName: fileName:/kt47082.kt - FUN name:produce visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>) returnType:E of .produce - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit> - annotations: - BuilderInference - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>): E of .produce declared in ' - TYPE_OP type=E of .produce origin=CAST typeOperand=E of .produce - CONST Null type=kotlin.Nothing? value=null - CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[.Base.Derived>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived.Derived> - TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> - TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Receiver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Receiver.Receiver> - TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:toChannel visibility:public modality:FINAL ($receiver:.Receiver.toChannel>, destination:C of .toChannel) returnType:C of .toChannel - TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] - TYPE_PARAMETER name:C index:1 variance: superTypes:[.Base.toChannel>] - $receiver: VALUE_PARAMETER name: type:.Receiver.toChannel> - VALUE_PARAMETER name:destination index:0 type:C of .toChannel - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun toChannel (destination: C of .toChannel): C of .toChannel declared in ' - TYPE_OP type=C of .toChannel origin=CAST typeOperand=C of .toChannel - CONST Null type=kotlin.Nothing? value=null - FUN name:foo visibility:public modality:FINAL (r:.Receiver.foo>) returnType:R of .foo - TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:r index:0 type:.Receiver.foo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (r: .Receiver.foo>): R of .foo declared in ' - CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>): E of .produce declared in ' type=R of .foo origin=null - : R of .foo - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.Derived, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.Derived) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name:$this$produce type:.Derived - BLOCK_BODY - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun toChannel (destination: C of .toChannel): C of .toChannel declared in ' type=.Derived origin=null - : R of .foo - : .Derived - $receiver: GET_VAR 'r: .Receiver.foo> declared in .foo' type=.Receiver.foo> origin=null - destination: GET_VAR '$this$produce: .Derived declared in .foo.' type=.Derived origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/expressions/kt47082.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt47082.fir.kt.txt deleted file mode 100644 index f3b306a7ae3..00000000000 --- a/compiler/testData/ir/irText/expressions/kt47082.fir.kt.txt +++ /dev/null @@ -1,31 +0,0 @@ -fun produce(@BuilderInference block: @ExtensionFunctionType Function1, Unit>): E { - return null as E -} - -interface Derived : Base { - -} - -interface Base { - -} - -interface Receiver { - -} - -fun > Receiver.toChannel(destination: C): C { - return null as C -} - -fun foo(r: Receiver): R { - return produce(block = local fun Derived.() { - r.toChannel>(destination = $this$produce) /*~> Unit */ - } -) -} - -fun box(): String { - return "OK" -} - diff --git a/compiler/testData/ir/irText/expressions/kt47082.kt b/compiler/testData/ir/irText/expressions/kt47082.kt index 998cbde6e11..9cc008a651e 100644 --- a/compiler/testData/ir/irText/expressions/kt47082.kt +++ b/compiler/testData/ir/irText/expressions/kt47082.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM // WITH_STDLIB // !OPT_IN: kotlin.experimental.ExperimentalTypeInference