From d2f8b143ba77d7d938c711f0043648603e1d76cc Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 19 Aug 2021 18:04:58 +0300 Subject: [PATCH] ~ Fix some test data --- ...ecatedGetSetPropertyDelegateConvention.fir.kt | 4 ++-- .../differentDelegatedExpressions.fir.kt | 8 ++++---- .../inference/genericMethodInGenericClass.fir.kt | 4 ++-- .../inference/genericMethods.fir.kt | 2 +- .../noErrorsForImplicitConstraints.fir.kt | 4 ++-- .../noExpectedTypeForSupertypeConstraint.fir.kt | 2 +- .../propertyDefferedType.fir.kt | 2 +- .../noOperatorModifierOnProvideDelegate.fir.kt | 16 ---------------- .../noOperatorModifierOnProvideDelegate.kt | 1 + .../typeMismatchForGetReturnType.fir.kt | 2 +- .../tests/typeParameters/kt42472.fir.kt | 2 +- 11 files changed, 16 insertions(+), 31 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.fir.kt 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 d89bd1f7a72..46f73ef6097 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/genericMethodInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt index 3bba6c5ac33..85fd391bac9 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..2d3835d2c3f 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/noErrorsForImplicitConstraints.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.fir.kt index 914e317e5d0..943315be3d0 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.fir.kt @@ -3,8 +3,8 @@ package foo import kotlin.reflect.KProperty class A { - var a5: String by MyProperty1() - var b5: String by getMyProperty1() + var a5: String by MyProperty1() + var b5: String by getMyProperty1() } fun getMyProperty1() = MyProperty1() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.fir.kt index 2329d6c5120..4018fda9671 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..9482d31fdf4 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 deleted file mode 100644 index d896f77a2d4..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class StringDelegate(val s: String) { - operator fun getValue(a: Any?, p: KProperty<*>): Int = 42 -} - -// NB no operator -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 test3 by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt index d92e6ab8bf5..73b980ddbad 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt index 0bc66c979b6..40ab6b16e32 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 884516f1ee3..ba2c164cf73 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 }