diff --git a/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.kt b/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.kt new file mode 100644 index 00000000000..d69a4ea4181 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.kt @@ -0,0 +1,17 @@ +// FILE: Condition.java + +public interface Condition { + boolean value(boolean t); +} + +// FILE: Foo.java + +public class Foo { + public Foo(Condition filter) {} +} + +// FILE: main.kt + +fun test() { + Foo { it } +} diff --git a/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt b/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt new file mode 100644 index 00000000000..f6022e0acd6 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt @@ -0,0 +1,7 @@ +FILE: main.kt + public final fun test(): R|kotlin/Unit| { + #( = Foo@fun (): { + # + } + ) + } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java index f292e706df9..04ce660cba7 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -913,6 +913,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/resolve/testData/resolve/problems/receiverWithCapturedType.kt"); } + @TestMetadata("samConversionInConstructorCall.kt") + public void testSamConversionInConstructorCall() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.kt"); + } + @TestMetadata("syntheticsVsNormalProperties.kt") public void testSyntheticsVsNormalProperties() throws Exception { runTest("compiler/fir/resolve/testData/resolve/problems/syntheticsVsNormalProperties.kt");