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 d8279553742..54311c1cca1 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 @@ -8585,6 +8585,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt"); } + @Test + @TestMetadata("kt41952.kt") + public void testKt41952() throws Exception { + runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt"); + } + @Test @TestMetadata("labeledDelegatedExpression.kt") public void testLabeledDelegatedExpression() throws Exception { 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 403c4e5d884..6f894e50095 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 @@ -8591,6 +8591,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt"); } + @Test + @TestMetadata("kt41952.kt") + public void testKt41952() throws Exception { + runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt"); + } + @Test @TestMetadata("labeledDelegatedExpression.kt") public void testLabeledDelegatedExpression() 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 90bc1154bae..c954aa16a47 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 @@ -8585,6 +8585,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt"); } + @Test + @TestMetadata("kt41952.kt") + public void testKt41952() throws Exception { + runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt"); + } + @Test @TestMetadata("labeledDelegatedExpression.kt") public void testLabeledDelegatedExpression() throws Exception { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt new file mode 100644 index 00000000000..25dda9912a2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt @@ -0,0 +1,23 @@ +// FIR_IDENTICAL +// ISSUE: KT-41952 + +import kotlin.reflect.KClass +import kotlin.reflect.KProperty + +class Issue { + val strings by bidir_collection(String::class) { + takeIssue(it) // Issue? instead of Issue + } +} + +fun takeIssue(issue: Issue) {} + +fun Self.bidir_collection(targetType: KClass, f: (Self) -> Unit): Delegate> = null!! + +class Delegate { + operator fun getValue(thisRef: R, property: KProperty<*>): T { + return null!! + } + + operator fun setValue(thisRef: R, property: KProperty<*>, value: T) {} +} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.txt new file mode 100644 index 00000000000..4a4273e77d0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.txt @@ -0,0 +1,21 @@ +package + +public fun takeIssue(/*0*/ issue: Issue): kotlin.Unit +public fun Self.bidir_collection(/*0*/ targetType: kotlin.reflect.KClass, /*1*/ f: (Self) -> kotlin.Unit): Delegate> + +public final class Delegate { + public constructor Delegate() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final operator fun getValue(/*0*/ thisRef: R, /*1*/ property: kotlin.reflect.KProperty<*>): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final operator fun setValue(/*0*/ thisRef: R, /*1*/ property: kotlin.reflect.KProperty<*>, /*2*/ value: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Issue { + public constructor Issue() + public final val strings: kotlin.collections.Collection + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} 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 a4ed83c7306..0090b3f5d8a 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 @@ -8591,6 +8591,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt"); } + @Test + @TestMetadata("kt41952.kt") + public void testKt41952() throws Exception { + runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/kt41952.kt"); + } + @Test @TestMetadata("labeledDelegatedExpression.kt") public void testLabeledDelegatedExpression() throws Exception {