From 4b5eac7816767f10b5c90dc2bd54bce7f1516550 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 28 Feb 2024 12:13:45 +0200 Subject: [PATCH] [Test] Add regression tests for issues which are fixed in K2 Related issues: KT-10879, KT-18055, KT-20617, KT-23873 KT-25668, KT-31191, KT-33108, KT-41013 KT-51827, KT-53886, KT-56624, KT-58447 KT-58458, KT-58751, KT-58814, KT-60597 KT-62806, KT-63258, KT-63444, KT-65101 KT-65408, KT-65844, KT-66186 ^KT-65926 Fixed --- ...CompilerTestFE10TestdataTestGenerated.java | 120 ++++++++++++++++++ ...LFirBlackBoxCodegenBasedTestGenerated.java | 18 +++ ...sticCompilerFE10TestDataTestGenerated.java | 120 ++++++++++++++++++ ...rsedBlackBoxCodegenBasedTestGenerated.java | 18 +++ ...eeOldFrontendDiagnosticsTestGenerated.java | 120 ++++++++++++++++++ ...siOldFrontendDiagnosticsTestGenerated.java | 120 ++++++++++++++++++ ...LightTreeBlackBoxCodegenTestGenerated.java | 18 +++ ...2IrFakeOverrideGeneratorTestGenerated.java | 18 +++ .../FirPsiBlackBoxCodegenTestGenerated.java | 18 +++ .../FirLightTreeJvmIrTextTestGenerated.java | 6 + .../ir/FirPsiJvmIrTextTestGenerated.java | 6 + .../lambdaWithTwoContextReceivers.kt | 27 ++++ .../box/inference/safeCastWithElvis.kt | 10 ++ .../box/lambda/ifWithReferenceAndLambda.kt | 25 ++++ .../annotations/OptInWithArrayArgument.fir.kt | 14 ++ .../annotations/OptInWithArrayArgument.kt | 14 ++ ...erenceOfAnnotatedFunctionInAnnotation.fail | 1 + ...eferenceOfAnnotatedFunctionInAnnotation.kt | 5 + .../tests/cast/nonUselessCastInLambda.fir.kt | 10 ++ .../tests/cast/nonUselessCastInLambda.kt | 10 ++ .../tests/cast/usefulCastInGetOperator.fir.kt | 15 +++ .../tests/cast/usefulCastInGetOperator.kt | 15 +++ .../tests/dataClasses/copyInDataObject.fir.kt | 7 + .../tests/dataClasses/copyInDataObject.kt | 7 + .../starProjection.fir.kt | 8 ++ .../starProjection.kt | 8 ++ .../aliasedImportOfEnumConstructor.fir.kt | 5 + .../imports/aliasedImportOfEnumConstructor.kt | 5 + ...plexInferenceOnParentizedExpression.fir.kt | 37 ++++++ .../complexInferenceOnParentizedExpression.kt | 37 ++++++ .../multipleDiagnosticsInOneCallChain.fir.kt | 10 ++ .../multipleDiagnosticsInOneCallChain.kt | 10 ++ .../tests/inner/starProjectedInnerType.fir.kt | 10 ++ .../tests/inner/starProjectedInnerType.kt | 10 ++ .../qualifiedThisInExtensionProperty.fir.kt | 15 +++ .../qualifiedThisInExtensionProperty.kt | 15 +++ ...isambiguateByNumberOfLambdaArgument.fir.kt | 15 +++ .../disambiguateByNumberOfLambdaArgument.kt | 15 +++ .../resolve/callToProtectedOnSmartcast.fir.kt | 20 +++ .../resolve/callToProtectedOnSmartcast.kt | 20 +++ ...artcastBetweenClassAndTypeParameter.fir.kt | 16 +++ .../smartcastBetweenClassAndTypeParameter.kt | 16 +++ ...theticAccessorOnSmartcastedReceiver.fir.kt | 17 +++ .../syntheticAccessorOnSmartcastedReceiver.kt | 17 +++ .../variables/propertyOfLocalClass.fir.kt | 13 ++ .../variables/propertyOfLocalClass.kt | 13 ++ .../unresolvedNameInBackticksInReceiver.fail | 5 + .../unresolvedNameInBackticksInReceiver.kt | 6 + .../withSubjectVariable/unnamedSubject.fail | 4 + .../withSubjectVariable/unnamedSubject.kt | 8 ++ ...artcastOnReceiverInComplexCondition.fir.kt | 14 ++ .../smartcastOnReceiverInComplexCondition.kt | 14 ++ .../callableReference.fir.kt | 10 ++ .../restrictSuspension/callableReference.kt | 10 ++ ...eOfDefinitelyNotNullableBoolean.fir.ir.txt | 48 +++++++ ...eOfDefinitelyNotNullableBoolean.fir.kt.txt | 22 ++++ ...efinitelyNotNullableBoolean.fir.sig.kt.txt | 29 +++++ ...renceOfDefinitelyNotNullableBoolean.ir.txt | 49 +++++++ ...inferenceOfDefinitelyNotNullableBoolean.kt | 28 ++++ ...renceOfDefinitelyNotNullableBoolean.kt.txt | 22 ++++ ...eOfDefinitelyNotNullableBoolean.sig.kt.txt | 31 +++++ .../test/runners/DiagnosticTestGenerated.java | 120 ++++++++++++++++++ .../JvmAbiConsistencyTestBoxGenerated.java | 18 +++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 ++ .../IrBlackBoxCodegenTestGenerated.java | 18 +++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 18 +++ ...xCodegenTestWithInlineScopesGenerated.java | 18 +++ .../ir/ClassicJvmIrTextTestGenerated.java | 6 + .../LightAnalysisModeTestGenerated.java | 15 +++ .../fir/FirJsCodegenBoxTestGenerated.java | 12 ++ .../fir/FirJsES6CodegenBoxTestGenerated.java | 12 ++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 12 ++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 12 ++ .../FirNativeCodegenBoxTestGenerated.java | 12 ++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 12 ++ .../NativeCodegenBoxTestGenerated.java | 12 ++ .../NativeCodegenBoxTestNoPLGenerated.java | 12 ++ .../FirWasmJsCodegenBoxTestGenerated.java | 12 ++ .../test/K1WasmCodegenBoxTestGenerated.java | 12 ++ 79 files changed, 1719 insertions(+) create mode 100644 compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt create mode 100644 compiler/testData/codegen/box/inference/safeCastWithElvis.kt create mode 100644 compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.fail create mode 100644 compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt create mode 100644 compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.fir.kt create mode 100644 compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt create mode 100644 compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.fir.kt create mode 100644 compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt create mode 100644 compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.fir.kt create mode 100644 compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt create mode 100644 compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.fir.kt create mode 100644 compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt create mode 100644 compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.fir.kt create mode 100644 compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt create mode 100644 compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt create mode 100644 compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt create mode 100644 compiler/testData/diagnostics/tests/inner/starProjectedInnerType.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt create mode 100644 compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.fir.kt create mode 100644 compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt create mode 100644 compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.fir.kt create mode 100644 compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt create mode 100644 compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.fir.kt create mode 100644 compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.fir.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.fir.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.fir.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt create mode 100644 compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.fail create mode 100644 compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt create mode 100644 compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.fail create mode 100644 compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.fir.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.fir.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.ir.txt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.kt.txt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.ir.txt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt.txt create mode 100644 compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.sig.kt.txt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index ea3153f2d5b..7dcd2ce69dd 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -1605,6 +1605,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/Unresolved.kt"); } + @Test + @TestMetadata("unresolvedNameInBackticksInReceiver.kt") + public void testUnresolvedNameInBackticksInReceiver() { + runTest("compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt"); + } + @Test @TestMetadata("UnusedInDestructuring.kt") public void testUnusedInDestructuring() { @@ -2316,6 +2322,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("OptInWithArrayArgument.kt") + public void testOptInWithArrayArgument() { + runTest("compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt"); + } + @Test @TestMetadata("propagationAnnotationToLocalMemberFunction.kt") public void testPropagationAnnotationToLocalMemberFunction() { @@ -2406,6 +2418,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt"); } + @Test + @TestMetadata("referenceOfAnnotatedFunctionInAnnotation.kt") + public void testReferenceOfAnnotatedFunctionInAnnotation() { + runTest("compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt"); + } + @Test @TestMetadata("requireKotlin.kt") public void testRequireKotlin() { @@ -6370,6 +6388,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/cast/kt614.kt"); } + @Test + @TestMetadata("nonUselessCastInLambda.kt") + public void testNonUselessCastInLambda() { + runTest("compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt"); + } + @Test @TestMetadata("nothingAs.kt") public void testNothingAs() { @@ -6388,6 +6412,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt"); } + @Test + @TestMetadata("usefulCastInGetOperator.kt") + public void testUsefulCastInGetOperator() { + runTest("compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt"); + } + @Test @TestMetadata("UselessSafeCast.kt") public void testUselessSafeCast() { @@ -9296,6 +9326,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.kt"); } + @Test + @TestMetadata("copyInDataObject.kt") + public void testCopyInDataObject() { + runTest("compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt"); + } + @Test @TestMetadata("copyOfPrivateClass.kt") public void testCopyOfPrivateClass() { @@ -13403,6 +13439,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia public void testSimple() { runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/simple.kt"); } + + @Test + @TestMetadata("starProjection.kt") + public void testStarProjection() { + runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt"); + } } @Nested @@ -15939,6 +15981,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia @TestMetadata("compiler/testData/diagnostics/tests/imports") @TestDataPath("$PROJECT_ROOT") public class Imports { + @Test + @TestMetadata("aliasedImportOfEnumConstructor.kt") + public void testAliasedImportOfEnumConstructor() { + runTest("compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt"); + } + @Test public void testAllFilesPresentInImports() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/imports"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); @@ -16718,6 +16766,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.kt"); } + @Test + @TestMetadata("complexInferenceOnParentizedExpression.kt") + public void testComplexInferenceOnParentizedExpression() { + runTest("compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt"); + } + @Test @TestMetadata("conflictingSubstitutions.kt") public void testConflictingSubstitutions() { @@ -20523,6 +20577,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.kt"); } + @Test + @TestMetadata("multipleDiagnosticsInOneCallChain.kt") + public void testMultipleDiagnosticsInOneCallChain() { + runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt"); + } + @Test @TestMetadata("NoAmbiguityForDifferentFunctionTypes.kt") public void testNoAmbiguityForDifferentFunctionTypes() { @@ -21946,6 +22006,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/inner/selfAnnotationForClassObject.kt"); } + @Test + @TestMetadata("starProjectedInnerType.kt") + public void testStarProjectedInnerType() { + runTest("compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt"); + } + @Test @TestMetadata("traits.kt") public void testTraits() { @@ -24265,6 +24331,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia public void testMultipleLabels() { runTest("compiler/testData/diagnostics/tests/labels/multipleLabels.kt"); } + + @Test + @TestMetadata("qualifiedThisInExtensionProperty.kt") + public void testQualifiedThisInExtensionProperty() { + runTest("compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt"); + } } @Nested @@ -28664,6 +28736,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt"); } + @Test + @TestMetadata("disambiguateByNumberOfLambdaArgument.kt") + public void testDisambiguateByNumberOfLambdaArgument() { + runTest("compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt"); + } + @Test @TestMetadata("doubleWinsOverFloat.kt") public void testDoubleWinsOverFloat() { @@ -32286,6 +32364,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt"); } + @Test + @TestMetadata("callToProtectedOnSmartcast.kt") + public void testCallToProtectedOnSmartcast() { + runTest("compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt"); + } + @Test @TestMetadata("callableReferenceInCST.kt") public void testCallableReferenceInCST() { @@ -36046,6 +36130,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastWithOrFalse.kt"); } + @Test + @TestMetadata("smartcastBetweenClassAndTypeParameter.kt") + public void testSmartcastBetweenClassAndTypeParameter() { + runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt"); + } + @Test @TestMetadata("smartcastInFriendModule.kt") public void testSmartcastInFriendModule() { @@ -36082,6 +36172,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastToStarProjection.kt"); } + @Test + @TestMetadata("syntheticAccessorOnSmartcastedReceiver.kt") + public void testSyntheticAccessorOnSmartcastedReceiver() { + runTest("compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt"); + } + @Test @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() { @@ -37405,6 +37501,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt"); } + @Test + @TestMetadata("propertyOfLocalClass.kt") + public void testPropertyOfLocalClass() { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt"); + } + @Test @TestMetadata("propertySubtype.kt") public void testPropertySubtype() { @@ -41967,6 +42069,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt"); } + @Test + @TestMetadata("unnamedSubject.kt") + public void testUnnamedSubject() { + runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt"); + } + @Test @TestMetadata("unsupportedFeature.kt") public void testUnsupportedFeature() { @@ -44027,6 +44135,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt"); } + @Test + @TestMetadata("smartcastOnReceiverInComplexCondition.kt") + public void testSmartcastOnReceiverInComplexCondition() { + runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt"); + } + @Test @TestMetadata("throwsEffect.kt") public void testThrowsEffect() { @@ -44969,6 +45083,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); } + @Test + @TestMetadata("callableReference.kt") + public void testCallableReference() { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt"); + } + @Test @TestMetadata("extensions.kt") public void testExtensions() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index ab64f4e387f..1f3cb305d5c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -22714,6 +22714,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -24020,6 +24026,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36506,6 +36518,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 5e30359131d..b699f4a8342 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -1605,6 +1605,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/Unresolved.kt"); } + @Test + @TestMetadata("unresolvedNameInBackticksInReceiver.kt") + public void testUnresolvedNameInBackticksInReceiver() { + runTest("compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt"); + } + @Test @TestMetadata("UnusedInDestructuring.kt") public void testUnusedInDestructuring() { @@ -2316,6 +2322,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("OptInWithArrayArgument.kt") + public void testOptInWithArrayArgument() { + runTest("compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt"); + } + @Test @TestMetadata("propagationAnnotationToLocalMemberFunction.kt") public void testPropagationAnnotationToLocalMemberFunction() { @@ -2406,6 +2418,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt"); } + @Test + @TestMetadata("referenceOfAnnotatedFunctionInAnnotation.kt") + public void testReferenceOfAnnotatedFunctionInAnnotation() { + runTest("compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt"); + } + @Test @TestMetadata("requireKotlin.kt") public void testRequireKotlin() { @@ -6370,6 +6388,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/cast/kt614.kt"); } + @Test + @TestMetadata("nonUselessCastInLambda.kt") + public void testNonUselessCastInLambda() { + runTest("compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt"); + } + @Test @TestMetadata("nothingAs.kt") public void testNothingAs() { @@ -6388,6 +6412,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt"); } + @Test + @TestMetadata("usefulCastInGetOperator.kt") + public void testUsefulCastInGetOperator() { + runTest("compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt"); + } + @Test @TestMetadata("UselessSafeCast.kt") public void testUselessSafeCast() { @@ -9296,6 +9326,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.kt"); } + @Test + @TestMetadata("copyInDataObject.kt") + public void testCopyInDataObject() { + runTest("compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt"); + } + @Test @TestMetadata("copyOfPrivateClass.kt") public void testCopyOfPrivateClass() { @@ -13403,6 +13439,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated public void testSimple() { runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/simple.kt"); } + + @Test + @TestMetadata("starProjection.kt") + public void testStarProjection() { + runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt"); + } } @Nested @@ -15939,6 +15981,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated @TestMetadata("compiler/testData/diagnostics/tests/imports") @TestDataPath("$PROJECT_ROOT") public class Imports { + @Test + @TestMetadata("aliasedImportOfEnumConstructor.kt") + public void testAliasedImportOfEnumConstructor() { + runTest("compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt"); + } + @Test public void testAllFilesPresentInImports() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/imports"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); @@ -16718,6 +16766,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.kt"); } + @Test + @TestMetadata("complexInferenceOnParentizedExpression.kt") + public void testComplexInferenceOnParentizedExpression() { + runTest("compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt"); + } + @Test @TestMetadata("conflictingSubstitutions.kt") public void testConflictingSubstitutions() { @@ -20523,6 +20577,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.kt"); } + @Test + @TestMetadata("multipleDiagnosticsInOneCallChain.kt") + public void testMultipleDiagnosticsInOneCallChain() { + runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt"); + } + @Test @TestMetadata("NoAmbiguityForDifferentFunctionTypes.kt") public void testNoAmbiguityForDifferentFunctionTypes() { @@ -21946,6 +22006,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/inner/selfAnnotationForClassObject.kt"); } + @Test + @TestMetadata("starProjectedInnerType.kt") + public void testStarProjectedInnerType() { + runTest("compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt"); + } + @Test @TestMetadata("traits.kt") public void testTraits() { @@ -24265,6 +24331,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated public void testMultipleLabels() { runTest("compiler/testData/diagnostics/tests/labels/multipleLabels.kt"); } + + @Test + @TestMetadata("qualifiedThisInExtensionProperty.kt") + public void testQualifiedThisInExtensionProperty() { + runTest("compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt"); + } } @Nested @@ -28664,6 +28736,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt"); } + @Test + @TestMetadata("disambiguateByNumberOfLambdaArgument.kt") + public void testDisambiguateByNumberOfLambdaArgument() { + runTest("compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt"); + } + @Test @TestMetadata("doubleWinsOverFloat.kt") public void testDoubleWinsOverFloat() { @@ -32286,6 +32364,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt"); } + @Test + @TestMetadata("callToProtectedOnSmartcast.kt") + public void testCallToProtectedOnSmartcast() { + runTest("compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt"); + } + @Test @TestMetadata("callableReferenceInCST.kt") public void testCallableReferenceInCST() { @@ -36046,6 +36130,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastWithOrFalse.kt"); } + @Test + @TestMetadata("smartcastBetweenClassAndTypeParameter.kt") + public void testSmartcastBetweenClassAndTypeParameter() { + runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt"); + } + @Test @TestMetadata("smartcastInFriendModule.kt") public void testSmartcastInFriendModule() { @@ -36082,6 +36172,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastToStarProjection.kt"); } + @Test + @TestMetadata("syntheticAccessorOnSmartcastedReceiver.kt") + public void testSyntheticAccessorOnSmartcastedReceiver() { + runTest("compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt"); + } + @Test @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() { @@ -37405,6 +37501,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt"); } + @Test + @TestMetadata("propertyOfLocalClass.kt") + public void testPropertyOfLocalClass() { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt"); + } + @Test @TestMetadata("propertySubtype.kt") public void testPropertySubtype() { @@ -41967,6 +42069,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt"); } + @Test + @TestMetadata("unnamedSubject.kt") + public void testUnnamedSubject() { + runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt"); + } + @Test @TestMetadata("unsupportedFeature.kt") public void testUnsupportedFeature() { @@ -44027,6 +44135,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt"); } + @Test + @TestMetadata("smartcastOnReceiverInComplexCondition.kt") + public void testSmartcastOnReceiverInComplexCondition() { + runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt"); + } + @Test @TestMetadata("throwsEffect.kt") public void testThrowsEffect() { @@ -44969,6 +45083,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); } + @Test + @TestMetadata("callableReference.kt") + public void testCallableReference() { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt"); + } + @Test @TestMetadata("extensions.kt") public void testExtensions() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index 4e0cfa4cb7f..3cd0c908a47 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -22714,6 +22714,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -24020,6 +24026,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36506,6 +36518,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index d78c633a28e..da21dbf8368 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -1605,6 +1605,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/Unresolved.kt"); } + @Test + @TestMetadata("unresolvedNameInBackticksInReceiver.kt") + public void testUnresolvedNameInBackticksInReceiver() { + runTest("compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt"); + } + @Test @TestMetadata("UnusedInDestructuring.kt") public void testUnusedInDestructuring() { @@ -2310,6 +2316,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("OptInWithArrayArgument.kt") + public void testOptInWithArrayArgument() { + runTest("compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt"); + } + @Test @TestMetadata("propagationAnnotationToLocalMemberFunction.kt") public void testPropagationAnnotationToLocalMemberFunction() { @@ -2400,6 +2412,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt"); } + @Test + @TestMetadata("referenceOfAnnotatedFunctionInAnnotation.kt") + public void testReferenceOfAnnotatedFunctionInAnnotation() { + runTest("compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt"); + } + @Test @TestMetadata("requireKotlin.kt") public void testRequireKotlin() { @@ -6364,6 +6382,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/cast/kt614.kt"); } + @Test + @TestMetadata("nonUselessCastInLambda.kt") + public void testNonUselessCastInLambda() { + runTest("compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt"); + } + @Test @TestMetadata("nothingAs.kt") public void testNothingAs() { @@ -6382,6 +6406,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt"); } + @Test + @TestMetadata("usefulCastInGetOperator.kt") + public void testUsefulCastInGetOperator() { + runTest("compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt"); + } + @Test @TestMetadata("UselessSafeCast.kt") public void testUselessSafeCast() { @@ -9290,6 +9320,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.kt"); } + @Test + @TestMetadata("copyInDataObject.kt") + public void testCopyInDataObject() { + runTest("compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt"); + } + @Test @TestMetadata("copyOfPrivateClass.kt") public void testCopyOfPrivateClass() { @@ -13397,6 +13433,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir public void testSimple() { runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/simple.kt"); } + + @Test + @TestMetadata("starProjection.kt") + public void testStarProjection() { + runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt"); + } } @Nested @@ -15933,6 +15975,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir @TestMetadata("compiler/testData/diagnostics/tests/imports") @TestDataPath("$PROJECT_ROOT") public class Imports { + @Test + @TestMetadata("aliasedImportOfEnumConstructor.kt") + public void testAliasedImportOfEnumConstructor() { + runTest("compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt"); + } + @Test public void testAllFilesPresentInImports() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/imports"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); @@ -16712,6 +16760,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.kt"); } + @Test + @TestMetadata("complexInferenceOnParentizedExpression.kt") + public void testComplexInferenceOnParentizedExpression() { + runTest("compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt"); + } + @Test @TestMetadata("conflictingSubstitutions.kt") public void testConflictingSubstitutions() { @@ -20517,6 +20571,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.kt"); } + @Test + @TestMetadata("multipleDiagnosticsInOneCallChain.kt") + public void testMultipleDiagnosticsInOneCallChain() { + runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt"); + } + @Test @TestMetadata("NoAmbiguityForDifferentFunctionTypes.kt") public void testNoAmbiguityForDifferentFunctionTypes() { @@ -21940,6 +22000,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/inner/selfAnnotationForClassObject.kt"); } + @Test + @TestMetadata("starProjectedInnerType.kt") + public void testStarProjectedInnerType() { + runTest("compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt"); + } + @Test @TestMetadata("traits.kt") public void testTraits() { @@ -24259,6 +24325,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir public void testMultipleLabels() { runTest("compiler/testData/diagnostics/tests/labels/multipleLabels.kt"); } + + @Test + @TestMetadata("qualifiedThisInExtensionProperty.kt") + public void testQualifiedThisInExtensionProperty() { + runTest("compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt"); + } } @Nested @@ -26368,6 +26440,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt"); } + @Test + @TestMetadata("disambiguateByNumberOfLambdaArgument.kt") + public void testDisambiguateByNumberOfLambdaArgument() { + runTest("compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt"); + } + @Test @TestMetadata("doubleWinsOverFloat.kt") public void testDoubleWinsOverFloat() { @@ -29984,6 +30062,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt"); } + @Test + @TestMetadata("callToProtectedOnSmartcast.kt") + public void testCallToProtectedOnSmartcast() { + runTest("compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt"); + } + @Test @TestMetadata("callableReferenceInCST.kt") public void testCallableReferenceInCST() { @@ -33618,6 +33702,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastWithOrFalse.kt"); } + @Test + @TestMetadata("smartcastBetweenClassAndTypeParameter.kt") + public void testSmartcastBetweenClassAndTypeParameter() { + runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt"); + } + @Test @TestMetadata("smartcastInFriendModule.kt") public void testSmartcastInFriendModule() { @@ -33654,6 +33744,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastToStarProjection.kt"); } + @Test + @TestMetadata("syntheticAccessorOnSmartcastedReceiver.kt") + public void testSyntheticAccessorOnSmartcastedReceiver() { + runTest("compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt"); + } + @Test @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() { @@ -34977,6 +35073,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt"); } + @Test + @TestMetadata("propertyOfLocalClass.kt") + public void testPropertyOfLocalClass() { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt"); + } + @Test @TestMetadata("propertySubtype.kt") public void testPropertySubtype() { @@ -39539,6 +39641,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt"); } + @Test + @TestMetadata("unnamedSubject.kt") + public void testUnnamedSubject() { + runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt"); + } + @Test @TestMetadata("unsupportedFeature.kt") public void testUnsupportedFeature() { @@ -41599,6 +41707,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt"); } + @Test + @TestMetadata("smartcastOnReceiverInComplexCondition.kt") + public void testSmartcastOnReceiverInComplexCondition() { + runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt"); + } + @Test @TestMetadata("throwsEffect.kt") public void testThrowsEffect() { @@ -42541,6 +42655,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); } + @Test + @TestMetadata("callableReference.kt") + public void testCallableReference() { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt"); + } + @Test @TestMetadata("extensions.kt") public void testExtensions() { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 09fa3b9287d..70ffb17ed5a 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -1605,6 +1605,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/Unresolved.kt"); } + @Test + @TestMetadata("unresolvedNameInBackticksInReceiver.kt") + public void testUnresolvedNameInBackticksInReceiver() { + runTest("compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt"); + } + @Test @TestMetadata("UnusedInDestructuring.kt") public void testUnusedInDestructuring() { @@ -2316,6 +2322,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("OptInWithArrayArgument.kt") + public void testOptInWithArrayArgument() { + runTest("compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt"); + } + @Test @TestMetadata("propagationAnnotationToLocalMemberFunction.kt") public void testPropagationAnnotationToLocalMemberFunction() { @@ -2406,6 +2418,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt"); } + @Test + @TestMetadata("referenceOfAnnotatedFunctionInAnnotation.kt") + public void testReferenceOfAnnotatedFunctionInAnnotation() { + runTest("compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt"); + } + @Test @TestMetadata("requireKotlin.kt") public void testRequireKotlin() { @@ -6370,6 +6388,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/cast/kt614.kt"); } + @Test + @TestMetadata("nonUselessCastInLambda.kt") + public void testNonUselessCastInLambda() { + runTest("compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt"); + } + @Test @TestMetadata("nothingAs.kt") public void testNothingAs() { @@ -6388,6 +6412,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt"); } + @Test + @TestMetadata("usefulCastInGetOperator.kt") + public void testUsefulCastInGetOperator() { + runTest("compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt"); + } + @Test @TestMetadata("UselessSafeCast.kt") public void testUselessSafeCast() { @@ -9296,6 +9326,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.kt"); } + @Test + @TestMetadata("copyInDataObject.kt") + public void testCopyInDataObject() { + runTest("compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt"); + } + @Test @TestMetadata("copyOfPrivateClass.kt") public void testCopyOfPrivateClass() { @@ -13403,6 +13439,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia public void testSimple() { runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/simple.kt"); } + + @Test + @TestMetadata("starProjection.kt") + public void testStarProjection() { + runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt"); + } } @Nested @@ -15939,6 +15981,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia @TestMetadata("compiler/testData/diagnostics/tests/imports") @TestDataPath("$PROJECT_ROOT") public class Imports { + @Test + @TestMetadata("aliasedImportOfEnumConstructor.kt") + public void testAliasedImportOfEnumConstructor() { + runTest("compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt"); + } + @Test public void testAllFilesPresentInImports() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/imports"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); @@ -16718,6 +16766,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.kt"); } + @Test + @TestMetadata("complexInferenceOnParentizedExpression.kt") + public void testComplexInferenceOnParentizedExpression() { + runTest("compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt"); + } + @Test @TestMetadata("conflictingSubstitutions.kt") public void testConflictingSubstitutions() { @@ -20523,6 +20577,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.kt"); } + @Test + @TestMetadata("multipleDiagnosticsInOneCallChain.kt") + public void testMultipleDiagnosticsInOneCallChain() { + runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt"); + } + @Test @TestMetadata("NoAmbiguityForDifferentFunctionTypes.kt") public void testNoAmbiguityForDifferentFunctionTypes() { @@ -21946,6 +22006,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/inner/selfAnnotationForClassObject.kt"); } + @Test + @TestMetadata("starProjectedInnerType.kt") + public void testStarProjectedInnerType() { + runTest("compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt"); + } + @Test @TestMetadata("traits.kt") public void testTraits() { @@ -24265,6 +24331,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia public void testMultipleLabels() { runTest("compiler/testData/diagnostics/tests/labels/multipleLabels.kt"); } + + @Test + @TestMetadata("qualifiedThisInExtensionProperty.kt") + public void testQualifiedThisInExtensionProperty() { + runTest("compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt"); + } } @Nested @@ -26374,6 +26446,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt"); } + @Test + @TestMetadata("disambiguateByNumberOfLambdaArgument.kt") + public void testDisambiguateByNumberOfLambdaArgument() { + runTest("compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt"); + } + @Test @TestMetadata("doubleWinsOverFloat.kt") public void testDoubleWinsOverFloat() { @@ -29996,6 +30074,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt"); } + @Test + @TestMetadata("callToProtectedOnSmartcast.kt") + public void testCallToProtectedOnSmartcast() { + runTest("compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt"); + } + @Test @TestMetadata("callableReferenceInCST.kt") public void testCallableReferenceInCST() { @@ -33756,6 +33840,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastWithOrFalse.kt"); } + @Test + @TestMetadata("smartcastBetweenClassAndTypeParameter.kt") + public void testSmartcastBetweenClassAndTypeParameter() { + runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt"); + } + @Test @TestMetadata("smartcastInFriendModule.kt") public void testSmartcastInFriendModule() { @@ -33792,6 +33882,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastToStarProjection.kt"); } + @Test + @TestMetadata("syntheticAccessorOnSmartcastedReceiver.kt") + public void testSyntheticAccessorOnSmartcastedReceiver() { + runTest("compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt"); + } + @Test @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() { @@ -35115,6 +35211,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt"); } + @Test + @TestMetadata("propertyOfLocalClass.kt") + public void testPropertyOfLocalClass() { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt"); + } + @Test @TestMetadata("propertySubtype.kt") public void testPropertySubtype() { @@ -39677,6 +39779,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt"); } + @Test + @TestMetadata("unnamedSubject.kt") + public void testUnnamedSubject() { + runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt"); + } + @Test @TestMetadata("unsupportedFeature.kt") public void testUnsupportedFeature() { @@ -41737,6 +41845,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt"); } + @Test + @TestMetadata("smartcastOnReceiverInComplexCondition.kt") + public void testSmartcastOnReceiverInComplexCondition() { + runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt"); + } + @Test @TestMetadata("throwsEffect.kt") public void testThrowsEffect() { @@ -42679,6 +42793,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); } + @Test + @TestMetadata("callableReference.kt") + public void testCallableReference() { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt"); + } + @Test @TestMetadata("extensions.kt") public void testExtensions() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 6044aeae8bd..70b45e6b63f 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -22643,6 +22643,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java index 24ea4144891..d4ab60fb550 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java @@ -22643,6 +22643,12 @@ public class FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGener runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGener runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGener KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 5bed344950d..c7ff7fd5dc9 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -22643,6 +22643,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index a6036891831..efed6fb8356 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -4704,6 +4704,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI runTest("compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt"); } + @Test + @TestMetadata("inferenceOfDefinitelyNotNullableBoolean.kt") + public void testInferenceOfDefinitelyNotNullableBoolean() { + runTest("compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt"); + } + @Test @TestMetadata("intersectionType1.kt") public void testIntersectionType1() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index 1d76627e6c9..591e4f5ee36 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -4704,6 +4704,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { runTest("compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt"); } + @Test + @TestMetadata("inferenceOfDefinitelyNotNullableBoolean.kt") + public void testInferenceOfDefinitelyNotNullableBoolean() { + runTest("compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt"); + } + @Test @TestMetadata("intersectionType1.kt") public void testIntersectionType1() { diff --git a/compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt b/compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt new file mode 100644 index 00000000000..94a404d9f68 --- /dev/null +++ b/compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt @@ -0,0 +1,27 @@ +// LANGUAGE: +ContextReceivers +// TARGET_BACKEND: JVM_IR +// WITH_STDLIB +// ISSUE: KT-52887 + +interface SnarkRoute { + context(PageContext) + fun route(route: String, block: context(PageContext, SnarkRoute) () -> Unit) +} + +context(PageContext) +fun SnarkRoute.pagesFrom() { + route("") { + get { + + } + } +} + +data class PageContext(val context: String) + + +fun SnarkRoute.get(foo: ()-> Unit) {} + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/box/inference/safeCastWithElvis.kt b/compiler/testData/codegen/box/inference/safeCastWithElvis.kt new file mode 100644 index 00000000000..1d49413d782 --- /dev/null +++ b/compiler/testData/codegen/box/inference/safeCastWithElvis.kt @@ -0,0 +1,10 @@ +// WITH_STDLIB +// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6, WASM, NATIVE +// ISSUE: KT-62806 + +fun foo(x: Number) = x as? T ?: TODO() +val x: Int? = foo(1) + +fun box(): String { + return if (x == 1) "OK" else "Fail: $x" +} diff --git a/compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt b/compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt new file mode 100644 index 00000000000..910faf48d8d --- /dev/null +++ b/compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND_K1: ANY +// WITH_STDLIB +// ISSUE: KT-63258 + +class MethodReferenceNPE() { + private val singleRef: () -> Unit = + 1.let { + if (it == 0) { + { } + } else { + this@MethodReferenceNPE::myMethod + } + } + + private fun myMethod() {} + + fun run() { + singleRef() + } +} + +fun box(): String { + MethodReferenceNPE().run() + return "OK" +} diff --git a/compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.fir.kt b/compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.fir.kt new file mode 100644 index 00000000000..485d7378d6e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.fir.kt @@ -0,0 +1,14 @@ +// ISSUE: KT-65844 + +@RequiresOptIn +annotation class MyOptIn + +@MyOptIn +fun foo() {} + +@OptIn(markerClass = [MyOptIn::class]) // should be ok +class MyClass { + fun test() { + foo() + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt b/compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt new file mode 100644 index 00000000000..160a53bf79f --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt @@ -0,0 +1,14 @@ +// ISSUE: KT-65844 + +@RequiresOptIn +annotation class MyOptIn + +@MyOptIn +fun foo() {} + +@OptIn(markerClass = [MyOptIn::class]) // should be ok +class MyClass { + fun test() { + foo() + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.fail b/compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.fail new file mode 100644 index 00000000000..d4f879f4fe9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.fail @@ -0,0 +1 @@ +java.lang.AssertionError: Recursion detected on input: component2 diff --git a/compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt b/compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt new file mode 100644 index 00000000000..619dc2ee528 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt @@ -0,0 +1,5 @@ +// FIR_IDENTICAL +// WITH_STDLIB +// ISSUE: KT-58447 + +fun @ParameterName(component2) Int.component2() = this + 2 diff --git a/compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.fir.kt b/compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.fir.kt new file mode 100644 index 00000000000..e1df05ceb38 --- /dev/null +++ b/compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.fir.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-33108 +// FULL_JDK +import java.util.Optional + +open class A +class B : A() + +fun useOptional(): A { + return Optional.of(0).map { B() as A }.orElse(A()) +} diff --git a/compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt b/compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt new file mode 100644 index 00000000000..a444d80cf51 --- /dev/null +++ b/compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-33108 +// FULL_JDK +import java.util.Optional + +open class A +class B : A() + +fun useOptional(): A { + return Optional.of(0).map { B() as A }.orElse(A()) +} diff --git a/compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.fir.kt b/compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.fir.kt new file mode 100644 index 00000000000..506fb97e256 --- /dev/null +++ b/compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.fir.kt @@ -0,0 +1,15 @@ +// ISSUE: KT-23873 +// WITH_STDLIB +data class Holder(val data: T) + +val data: Map>, Int> = null!! + +val test = Holder(Holder(1)) + +fun test_1() { + data.get(test as Holder<*>) +} + +fun test_2() { + data[test as Holder<*>] +} diff --git a/compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt b/compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt new file mode 100644 index 00000000000..32cdb7a3865 --- /dev/null +++ b/compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt @@ -0,0 +1,15 @@ +// ISSUE: KT-23873 +// WITH_STDLIB +data class Holder(val data: T) + +val data: Map>, Int> = null!! + +val test = Holder(Holder(1)) + +fun test_1() { + data.get(test as Holder<*>) +} + +fun test_2() { + data[test as Holder<*>] +} diff --git a/compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.fir.kt new file mode 100644 index 00000000000..0616dc07b9b --- /dev/null +++ b/compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.fir.kt @@ -0,0 +1,7 @@ +// ISSUE: KT-65408 + +data object CreateBuilder : Builder { + fun foo(): CreateBuilder = copy() // should be an error +} + +interface Builder : Cloneable diff --git a/compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt b/compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt new file mode 100644 index 00000000000..a0a00b04d53 --- /dev/null +++ b/compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt @@ -0,0 +1,7 @@ +// ISSUE: KT-65408 + +data object CreateBuilder : Builder { + fun foo(): CreateBuilder = copy() // should be an error +} + +interface Builder : Cloneable diff --git a/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.fir.kt b/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.fir.kt new file mode 100644 index 00000000000..3bbd01c0414 --- /dev/null +++ b/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.fir.kt @@ -0,0 +1,8 @@ +// ISSUE: KT-58751 +class Result + +interface Convert { + fun convert(str: String): Result +} + +fun Convert<*>.cnv(value: String): Result = convert(value) diff --git a/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt b/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt new file mode 100644 index 00000000000..4dbff0d0ebe --- /dev/null +++ b/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt @@ -0,0 +1,8 @@ +// ISSUE: KT-58751 +class Result + +interface Convert { + fun convert(str: String): Result +} + +fun Convert<*>.cnv(value: String): Result = convert(value) diff --git a/compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.fir.kt b/compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.fir.kt new file mode 100644 index 00000000000..71d0c1f9614 --- /dev/null +++ b/compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.fir.kt @@ -0,0 +1,5 @@ +// ISSUE: KT-56624 +import A as B +enum class A { + E() +} diff --git a/compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt b/compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt new file mode 100644 index 00000000000..a046fb8e04a --- /dev/null +++ b/compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt @@ -0,0 +1,5 @@ +// ISSUE: KT-56624 +import A as B +enum class A { + E() +} diff --git a/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.fir.kt b/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.fir.kt new file mode 100644 index 00000000000..a0345b028c0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.fir.kt @@ -0,0 +1,37 @@ +// ISSUE: KT-65101 +// WITH_STDLIB +interface Context> +interface InterfaceA> + +class ABuilder, A: InterfaceA, B: InterfaceA> + +operator fun ABuilder.invoke(block: B.() -> Unit): Unit + where C: Context, + A: InterfaceA, + B: InterfaceA + = null!! + +object ContextImpl : Context +object RootA : InterfaceA + +class AImpl> : InterfaceA

{ + fun foo(): Int = null!! +} + +val , A: InterfaceA> A.impl get() = ABuilder>() + +fun test_1() { + RootA.apply { + (impl) { + foo() + } + } +} + +fun test_2() { + RootA.apply { + impl { + foo() + } + } +} diff --git a/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt b/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt new file mode 100644 index 00000000000..58c5d1a3919 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt @@ -0,0 +1,37 @@ +// ISSUE: KT-65101 +// WITH_STDLIB +interface Context> +interface InterfaceA> + +class ABuilder, A: InterfaceA, B: InterfaceA> + +operator fun ABuilder.invoke(block: B.() -> Unit): Unit + where C: Context, + A: InterfaceA, + B: InterfaceA + = null!! + +object ContextImpl : Context +object RootA : InterfaceA + +class AImpl> : InterfaceA

{ + fun foo(): Int = null!! +} + +val , A: InterfaceA> A.impl get() = ABuilder>() + +fun test_1() { + RootA.apply { + (impl) { + foo() + } + } +} + +fun test_2() { + RootA.apply { + impl { + foo() + } + } +} diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.fir.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.fir.kt new file mode 100644 index 00000000000..6fa4c013d0b --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.fir.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-66186 +// WITH_STDLIB +// FULL_JDK + +fun test() { + val list = listOf("asd", "sda") + list.stream() + .filter(String::isNotEmpty) + .collect(FakeClass.toList()) +} diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt new file mode 100644 index 00000000000..f3b3ec5f383 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-66186 +// WITH_STDLIB +// FULL_JDK + +fun test() { + val list = listOf("asd", "sda") + list.stream() + .filter(String::isNotEmpty) + .collect(FakeClass.toList()) +} diff --git a/compiler/testData/diagnostics/tests/inner/starProjectedInnerType.fir.kt b/compiler/testData/diagnostics/tests/inner/starProjectedInnerType.fir.kt new file mode 100644 index 00000000000..4255a787a3b --- /dev/null +++ b/compiler/testData/diagnostics/tests/inner/starProjectedInnerType.fir.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-63444 +class A { + inner class Ainner

{ + fun innerFun() {} + } + + fun test(w:Ainner<*>) { + w.innerFun() + } +} diff --git a/compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt b/compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt new file mode 100644 index 00000000000..67ade69f95d --- /dev/null +++ b/compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-63444 +class A { + inner class Ainner
{ + fun innerFun() {} + } + + fun test(w:Ainner<*>) { + w.innerFun() + } +} diff --git a/compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.fir.kt b/compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.fir.kt new file mode 100644 index 00000000000..c0e96202042 --- /dev/null +++ b/compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.fir.kt @@ -0,0 +1,15 @@ +// WITH_STDLIB +// ISSUE: KT-20617 + +fun Int.function() = run { + this@function + 1 +} + +val Int.property1: Int + get() { + return run { this@property1 + 1 } + } + +val Int.property2 get() = run { + this@property2 + 1 +} diff --git a/compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt b/compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt new file mode 100644 index 00000000000..b72ad3f02fa --- /dev/null +++ b/compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt @@ -0,0 +1,15 @@ +// WITH_STDLIB +// ISSUE: KT-20617 + +fun Int.function() = run { + this@function + 1 +} + +val Int.property1: Int + get() { + return run { this@property1 + 1 } + } + +val Int.property2 get() = run { + this@property2 + 1 +} diff --git a/compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.fir.kt b/compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.fir.kt new file mode 100644 index 00000000000..653208adb94 --- /dev/null +++ b/compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.fir.kt @@ -0,0 +1,15 @@ +// WITH_STDLIB +// ISSUE: KT-41013 + +fun Iterable.map(transform: (V) -> R): List { + return this.mapIndexed { i, v -> transform(v) } +} +fun Iterable.map(transform: (V, Int) -> R): List { + return this.mapIndexed { i, v -> transform(v, i) } +} + +fun main() { + val list = listOf(1, 2, 3) + println(list.map { v -> v }) + println(list.map { it }) +} diff --git a/compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt b/compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt new file mode 100644 index 00000000000..0bd7819136c --- /dev/null +++ b/compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt @@ -0,0 +1,15 @@ +// WITH_STDLIB +// ISSUE: KT-41013 + +fun Iterable.map(transform: (V) -> R): List { + return this.mapIndexed { i, v -> transform(v) } +} +fun Iterable.map(transform: (V, Int) -> R): List { + return this.mapIndexed { i, v -> transform(v, i) } +} + +fun main() { + val list = listOf(1, 2, 3) + println(list.map { v -> v }) + println(list.map { it }) +} diff --git a/compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.fir.kt b/compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.fir.kt new file mode 100644 index 00000000000..d0b7cc85f22 --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.fir.kt @@ -0,0 +1,20 @@ +// ISSUE: KT-51827 +abstract class A { + abstract protected val a: Any? + + open class Nested(override val a: String) : A() { + class B { + fun f(other: A) { + other.a + if (other is Nested) { + other.a.length + } + if (other is C) { + other.a + } + } + } + } + + class C(override val a: String): Nested(a) +} diff --git a/compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt b/compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt new file mode 100644 index 00000000000..00e2517dac1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt @@ -0,0 +1,20 @@ +// ISSUE: KT-51827 +abstract class A { + abstract protected val a: Any? + + open class Nested(override val a: String) : A() { + class B { + fun f(other: A) { + other.a + if (other is Nested) { + other.a.length + } + if (other is C) { + other.a + } + } + } + } + + class C(override val a: String): Nested(a) +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.fir.kt new file mode 100644 index 00000000000..2fddf07d700 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.fir.kt @@ -0,0 +1,16 @@ +// FULL_JDK +// WITH_REFLECT +// ISSUE: KT-58814 + +open class A +class B : A() +class C : A() + +fun createObj(implementedBy: Class): T { + val obj = when (implementedBy) { + B::class.java -> B() + else -> throw Exception("unsupported class") + } + val castObj = implementedBy.cast(obj) + return castObj // should be OK +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt new file mode 100644 index 00000000000..54b12932051 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt @@ -0,0 +1,16 @@ +// FULL_JDK +// WITH_REFLECT +// ISSUE: KT-58814 + +open class A +class B : A() +class C : A() + +fun createObj(implementedBy: Class): T { + val obj = when (implementedBy) { + B::class.java -> B() + else -> throw Exception("unsupported class") + } + val castObj = implementedBy.cast(obj) + return castObj // should be OK +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.fir.kt new file mode 100644 index 00000000000..cd0ee358484 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.fir.kt @@ -0,0 +1,17 @@ +// ISSUE: KT-10879 +// FILE: A.java +public interface A { + A getFoo(); +} + +// FILE: main.kt +interface B : A +interface C : A + +fun test(x: A) { + if (x !is C) return + if (x is B) { + x.foo.foo + x.getFoo().foo + } +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt b/compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt new file mode 100644 index 00000000000..ce52b5ae142 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt @@ -0,0 +1,17 @@ +// ISSUE: KT-10879 +// FILE: A.java +public interface A { + A getFoo(); +} + +// FILE: main.kt +interface B : A +interface C : A + +fun test(x: A) { + if (x !is C) return + if (x is B) { + x.foo.foo + x.getFoo().foo + } +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.fir.kt new file mode 100644 index 00000000000..2dd045bbd7d --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.fir.kt @@ -0,0 +1,13 @@ +// ISSUE: KT-18055 + +fun main() { + data class Stat(val link: String? = null) + + var stat = Stat() + + if (stat.link != null) { + takeString(stat.link) + } +} + +fun takeString(link: String) {} diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt new file mode 100644 index 00000000000..978a82e8b1e --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt @@ -0,0 +1,13 @@ +// ISSUE: KT-18055 + +fun main() { + data class Stat(val link: String? = null) + + var stat = Stat() + + if (stat.link != null) { + takeString(stat.link) + } +} + +fun takeString(link: String) {} diff --git a/compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.fail b/compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.fail new file mode 100644 index 00000000000..9d1ae6824dc --- /dev/null +++ b/compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.fail @@ -0,0 +1,5 @@ +java.lang.IllegalArgumentException: fromIndex(0) > toIndex(-1) + at java.util.ArrayList.subListRangeCheck(ArrayList.java:1016) + at java.util.ArrayList.subList(ArrayList.java:1006) + at org.jetbrains.kotlin.resolve.QualifiedExpressionResolver.quickResolveToPackage(QualifiedExpressionResolver.kt:708) + at org.jetbrains.kotlin.resolve.QualifiedExpressionResolver.resolveToPackageOrClassPrefix(QualifiedExpressionResolver.kt:527) diff --git a/compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt b/compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt new file mode 100644 index 00000000000..763807689cb --- /dev/null +++ b/compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt @@ -0,0 +1,6 @@ +// FIR_IDENTICAL +// ISSUE: KT-60597 + +fun test() { + `java.lang.Short.TYPE`.getConstructor(TODO()) +} diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.fail b/compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.fail new file mode 100644 index 00000000000..fb1f1f3c314 --- /dev/null +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.fail @@ -0,0 +1,4 @@ +java.lang.NullPointerException + at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor$Subject$Variable.makeValueArgument(PatternMatchingTypingVisitor.kt:149) + at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor$checkWhenCondition$1.visitWhenConditionInRange(PatternMatchingTypingVisitor.kt:509) + at org.jetbrains.kotlin.psi.KtVisitorVoid.visitWhenConditionInRange(KtVisitorVoid.java:1015) diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt new file mode 100644 index 00000000000..273e98fff87 --- /dev/null +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt @@ -0,0 +1,8 @@ +// FIR_IDENTICAL +// ISSUE: KT-58458 + +fun box() = + when (val = x) { + in y -> "" + else -> "" + } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.fir.kt new file mode 100644 index 00000000000..e6e0f6b4dfb --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.fir.kt @@ -0,0 +1,14 @@ +// ISSUE: KT-31191 +import kotlin.contracts.* + +@OptIn(ExperimentalContracts::class) +fun Any.isString(): Boolean { + contract { returns(true) implies (this@isString is String) } + return this is String +} + +fun test(x: Any?) { + if (x != null && x.isString()) { + x.length + } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt new file mode 100644 index 00000000000..521fd418135 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt @@ -0,0 +1,14 @@ +// ISSUE: KT-31191 +import kotlin.contracts.* + +@OptIn(ExperimentalContracts::class) +fun Any.isString(): Boolean { + contract { returns(true) implies (this@isString is String) } + return this is String +} + +fun test(x: Any?) { + if (x != null && x.isString()) { + x.length + } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.fir.kt new file mode 100644 index 00000000000..4d7c1ba8aaf --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.fir.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-25668 +suspend fun SequenceScope.bar() = yield(1) + +fun test() { + val seq = sequence { + val f: suspend SequenceScope.() -> Unit = SequenceScope::bar + f() + } + seq.toList() +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt new file mode 100644 index 00000000000..7b8a7c9a249 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt @@ -0,0 +1,10 @@ +// ISSUE: KT-25668 +suspend fun SequenceScope.bar() = yield(1) + +fun test() { + val seq = sequence { + val f: suspend SequenceScope.() -> Unit = SequenceScope::bar + f() + } + seq.toList() +} diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.ir.txt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.ir.txt new file mode 100644 index 00000000000..68633d7cc9e --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.ir.txt @@ -0,0 +1,48 @@ +FILE fqName: fileName:/test.kt + PROPERTY name:key visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:key type:.A.Key visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .A.Key' type=.A.Key origin=null + : kotlin.Boolean + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A.Key + correspondingProperty: PROPERTY name:key visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A.Key declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:.A.Key visibility:private [final,static]' type=.A.Key origin=null + PROPERTY name:x visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:x$delegate type:kotlin.Lazy visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null + : kotlin.Boolean + initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Boolean declared in .x$delegate' + BLOCK type=kotlin.Boolean origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:@[EnhancedNullability] kotlin.Boolean? [val] + CALL 'public open fun get (key: @[EnhancedNullability] .A.Key<@[FlexibleNullability] T of .A.get?>): @[EnhancedNullability] T of .A.get? declared in .A' type=@[EnhancedNullability] kotlin.Boolean? origin=null + : @[FlexibleNullability] kotlin.Boolean? + $this: CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + key: CALL 'public final fun (): .A.Key declared in ' type=.A.Key origin=GET_PROPERTY + WHEN type=kotlin.Boolean origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: @[EnhancedNullability] kotlin.Boolean? declared in .x$delegate.' type=@[EnhancedNullability] kotlin.Boolean? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: @[EnhancedNullability] kotlin.Boolean? declared in .x$delegate.' type=@[EnhancedNullability] kotlin.Boolean? origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in ' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlin.Boolean origin=null + : kotlin.Boolean + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:x$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final x: kotlin.Boolean' field=null getter='public final fun (): kotlin.Boolean declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Boolean): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: CALL 'public final fun (): kotlin.Boolean declared in ' type=kotlin.Boolean origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.kt.txt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.kt.txt new file mode 100644 index 00000000000..f8c162514bc --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.kt.txt @@ -0,0 +1,22 @@ +val key: Key + field = Key() + get + +val x: Boolean /* by */ + field = lazy(initializer = local fun (): Boolean { + return { // BLOCK + val tmp_0: @EnhancedNullability Boolean? = A().get<@FlexibleNullability Boolean?>(key = ()) + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> false + else -> tmp_0 + } + } + } +) + get(): Boolean { + return #x$delegate.getValue(thisRef = null, property = ::x) + } + +fun main() { + println(message = ()) +} diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.sig.kt.txt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.sig.kt.txt new file mode 100644 index 00000000000..5cb6654d0fe --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.fir.sig.kt.txt @@ -0,0 +1,29 @@ +// CHECK: +// Mangled name: {}key +// Public signature: /key|1144547298251177939[0] +// Public signature debug description: {}key +val key: Key + // CHECK JVM_IR: + // Mangled name: #(){}A.Key + // Public signature: /key.|-6107443460337397211[0] + // Public signature debug description: (){}A.Key + get + +// CHECK: +// Mangled name: {}x +// Public signature: /x|-8060530855978347579[0] +// Public signature debug description: {}x +val x: Boolean /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Boolean + // Public signature: /x.|1798055433828515329[0] + // Public signature debug description: (){}kotlin.Boolean + get(): Boolean + +// CHECK JVM_IR: +// Mangled name: #main(){} +// Mangled name for the signature by IR: main(){} +// Mangled name for the signature by Frontend: main(){}%test.kt +// Public signature: /main|-4284757841571462650[0] +// Public signature debug description: main(){} +fun main(): Unit diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.ir.txt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.ir.txt new file mode 100644 index 00000000000..f55967831e6 --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.ir.txt @@ -0,0 +1,49 @@ +FILE fqName: fileName:/test.kt + PROPERTY name:key visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:key type:.A.Key visibility:private [final,static] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .A.Key' type=.A.Key origin=null + : @[FlexibleNullability] kotlin.Boolean? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A.Key + correspondingProperty: PROPERTY name:key visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A.Key declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:.A.Key visibility:private [final,static]' type=.A.Key origin=null + PROPERTY name:x visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:x$delegate type:kotlin.Lazy<@[EnhancedNullability] kotlin.Boolean> visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy<@[EnhancedNullability] kotlin.Boolean> origin=null + : @[EnhancedNullability] kotlin.Boolean + initializer: FUN_EXPR type=kotlin.Function0<@[EnhancedNullability] kotlin.Boolean> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:@[EnhancedNullability] kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): @[EnhancedNullability] kotlin.Boolean declared in .x$delegate' + BLOCK type=@[EnhancedNullability] kotlin.Boolean origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:@[EnhancedNullability] kotlin.Boolean? [val] + CALL 'public open fun get (key: @[EnhancedNullability] .A.Key<@[FlexibleNullability] T of .A.get?>): @[EnhancedNullability] T of .A.get? declared in .A' type=@[EnhancedNullability] kotlin.Boolean? origin=null + : @[FlexibleNullability] kotlin.Boolean? + $this: CONSTRUCTOR_CALL 'public constructor () declared in .A' type=.A origin=null + key: CALL 'public final fun (): .A.Key declared in ' type=.A.Key origin=GET_PROPERTY + WHEN type=@[EnhancedNullability] kotlin.Boolean origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: @[EnhancedNullability] kotlin.Boolean? declared in .x$delegate.' type=@[EnhancedNullability] kotlin.Boolean? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: @[EnhancedNullability] kotlin.Boolean? declared in .x$delegate.' type=@[EnhancedNullability] kotlin.Boolean? origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:@[EnhancedNullability] kotlin.Boolean + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): @[EnhancedNullability] kotlin.Boolean declared in ' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=@[EnhancedNullability] kotlin.Boolean origin=null + : @[EnhancedNullability] kotlin.Boolean + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:x$delegate type:kotlin.Lazy<@[EnhancedNullability] kotlin.Boolean> visibility:private [final,static]' type=kotlin.Lazy<@[EnhancedNullability] kotlin.Boolean> origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final x: @[EnhancedNullability] kotlin.Boolean' field=null getter='public final fun (): @[EnhancedNullability] kotlin.Boolean declared in ' setter=null type=kotlin.reflect.KProperty0<@[EnhancedNullability] kotlin.Boolean> origin=PROPERTY_REFERENCE_FOR_DELEGATE + FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun println (message: kotlin.Boolean): kotlin.Unit declared in kotlin.io' type=kotlin.Unit origin=null + message: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_NOTNULL typeOperand=kotlin.Boolean + CALL 'public final fun (): @[EnhancedNullability] kotlin.Boolean declared in ' type=@[EnhancedNullability] kotlin.Boolean origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt new file mode 100644 index 00000000000..7ba0438629a --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt @@ -0,0 +1,28 @@ +// TARGET_BACKEND: JVM_IR +// SEPARATE_SIGNATURE_DUMP_FOR_K2 +// ISSUE: KT-53886 +// WITH_STDLIB + +// FILE: A.java +import org.jetbrains.annotations.*; + +public class A { + @Nullable + public T get(@NotNull Key key) { + return null; + } + + public static class Key {} +} + +// FILE: test.kt + +val key = A.Key() + +val x by lazy { + A().get(key) ?: false +} + +fun main() { + println(x) +} diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt.txt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt.txt new file mode 100644 index 00000000000..7aa1ea3b4de --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt.txt @@ -0,0 +1,22 @@ +val key: Key + field = Key<@FlexibleNullability Boolean?>() + get + +val x: @EnhancedNullability Boolean /* by */ + field = lazy<@EnhancedNullability Boolean>(initializer = local fun (): @EnhancedNullability Boolean { + return { // BLOCK + val tmp_0: @EnhancedNullability Boolean? = A().get<@FlexibleNullability Boolean?>(key = ()) + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> false + else -> tmp_0 + } + } + } +) + get(): @EnhancedNullability Boolean { + return #x$delegate.getValue<@EnhancedNullability Boolean>(thisRef = null, property = ::x) + } + +fun main() { + println(message = () /*!! Boolean */) +} diff --git a/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.sig.kt.txt b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.sig.kt.txt new file mode 100644 index 00000000000..6a6ac776328 --- /dev/null +++ b/compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.sig.kt.txt @@ -0,0 +1,31 @@ +// CHECK: +// Mangled name: {}key +// Public signature: /key|1144547298251177939[0] +// Public signature debug description: {}key +val key: Key + // CHECK JVM_IR: + // Mangled name: #(){}A.Key + // Public signature: /key.|-6107443460337397211[0] + // Public signature debug description: (){}A.Key + get + +// CHECK: +// Mangled name: {}x +// Public signature: /x|-8060530855978347579[0] +// Public signature debug description: {}x +val x: @EnhancedNullability Boolean /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Boolean{EnhancedNullability} + // Public signature: /x.|-384063749268193272[0] + // Public signature debug description: (){}kotlin.Boolean{EnhancedNullability} + get(): @EnhancedNullability Boolean + +// CHECK JVM_IR: +// Mangled name: #main(){} +// Mangled name for the signature by IR: main(){} +// Mangled name for the signature by Frontend: main(){}%test.kt +// Public signature by IR: /main|-4284757841571462650[0] +// Public signature by IR debug description: main(){} +// Public signature by Frontend: /main|-2141841464851950582[0] +// Public signature by Frontend debug description: main(){}%test.kt +fun main(): Unit 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 6efef897a53..85ef0cbb35f 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 @@ -1605,6 +1605,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/Unresolved.kt"); } + @Test + @TestMetadata("unresolvedNameInBackticksInReceiver.kt") + public void testUnresolvedNameInBackticksInReceiver() { + runTest("compiler/testData/diagnostics/tests/unresolvedNameInBackticksInReceiver.kt"); + } + @Test @TestMetadata("UnusedInDestructuring.kt") public void testUnusedInDestructuring() { @@ -2316,6 +2322,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("OptInWithArrayArgument.kt") + public void testOptInWithArrayArgument() { + runTest("compiler/testData/diagnostics/tests/annotations/OptInWithArrayArgument.kt"); + } + @Test @TestMetadata("propagationAnnotationToLocalMemberFunction.kt") public void testPropagationAnnotationToLocalMemberFunction() { @@ -2406,6 +2418,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt"); } + @Test + @TestMetadata("referenceOfAnnotatedFunctionInAnnotation.kt") + public void testReferenceOfAnnotatedFunctionInAnnotation() { + runTest("compiler/testData/diagnostics/tests/annotations/referenceOfAnnotatedFunctionInAnnotation.kt"); + } + @Test @TestMetadata("requireKotlin.kt") public void testRequireKotlin() { @@ -6370,6 +6388,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/cast/kt614.kt"); } + @Test + @TestMetadata("nonUselessCastInLambda.kt") + public void testNonUselessCastInLambda() { + runTest("compiler/testData/diagnostics/tests/cast/nonUselessCastInLambda.kt"); + } + @Test @TestMetadata("nothingAs.kt") public void testNothingAs() { @@ -6388,6 +6412,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt"); } + @Test + @TestMetadata("usefulCastInGetOperator.kt") + public void testUsefulCastInGetOperator() { + runTest("compiler/testData/diagnostics/tests/cast/usefulCastInGetOperator.kt"); + } + @Test @TestMetadata("UselessSafeCast.kt") public void testUselessSafeCast() { @@ -9296,6 +9326,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.kt"); } + @Test + @TestMetadata("copyInDataObject.kt") + public void testCopyInDataObject() { + runTest("compiler/testData/diagnostics/tests/dataClasses/copyInDataObject.kt"); + } + @Test @TestMetadata("copyOfPrivateClass.kt") public void testCopyOfPrivateClass() { @@ -13403,6 +13439,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { public void testSimple() { runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/simple.kt"); } + + @Test + @TestMetadata("starProjection.kt") + public void testStarProjection() { + runTest("compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/starProjection.kt"); + } } @Nested @@ -15939,6 +15981,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { @TestMetadata("compiler/testData/diagnostics/tests/imports") @TestDataPath("$PROJECT_ROOT") public class Imports { + @Test + @TestMetadata("aliasedImportOfEnumConstructor.kt") + public void testAliasedImportOfEnumConstructor() { + runTest("compiler/testData/diagnostics/tests/imports/aliasedImportOfEnumConstructor.kt"); + } + @Test public void testAllFilesPresentInImports() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/imports"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); @@ -16718,6 +16766,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.kt"); } + @Test + @TestMetadata("complexInferenceOnParentizedExpression.kt") + public void testComplexInferenceOnParentizedExpression() { + runTest("compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt"); + } + @Test @TestMetadata("conflictingSubstitutions.kt") public void testConflictingSubstitutions() { @@ -20523,6 +20577,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.kt"); } + @Test + @TestMetadata("multipleDiagnosticsInOneCallChain.kt") + public void testMultipleDiagnosticsInOneCallChain() { + runTest("compiler/testData/diagnostics/tests/inference/reportingImprovements/multipleDiagnosticsInOneCallChain.kt"); + } + @Test @TestMetadata("NoAmbiguityForDifferentFunctionTypes.kt") public void testNoAmbiguityForDifferentFunctionTypes() { @@ -21946,6 +22006,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inner/selfAnnotationForClassObject.kt"); } + @Test + @TestMetadata("starProjectedInnerType.kt") + public void testStarProjectedInnerType() { + runTest("compiler/testData/diagnostics/tests/inner/starProjectedInnerType.kt"); + } + @Test @TestMetadata("traits.kt") public void testTraits() { @@ -24265,6 +24331,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { public void testMultipleLabels() { runTest("compiler/testData/diagnostics/tests/labels/multipleLabels.kt"); } + + @Test + @TestMetadata("qualifiedThisInExtensionProperty.kt") + public void testQualifiedThisInExtensionProperty() { + runTest("compiler/testData/diagnostics/tests/labels/qualifiedThisInExtensionProperty.kt"); + } } @Nested @@ -28664,6 +28736,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt"); } + @Test + @TestMetadata("disambiguateByNumberOfLambdaArgument.kt") + public void testDisambiguateByNumberOfLambdaArgument() { + runTest("compiler/testData/diagnostics/tests/overload/disambiguateByNumberOfLambdaArgument.kt"); + } + @Test @TestMetadata("doubleWinsOverFloat.kt") public void testDoubleWinsOverFloat() { @@ -32286,6 +32364,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt"); } + @Test + @TestMetadata("callToProtectedOnSmartcast.kt") + public void testCallToProtectedOnSmartcast() { + runTest("compiler/testData/diagnostics/tests/resolve/callToProtectedOnSmartcast.kt"); + } + @Test @TestMetadata("callableReferenceInCST.kt") public void testCallableReferenceInCST() { @@ -36046,6 +36130,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastWithOrFalse.kt"); } + @Test + @TestMetadata("smartcastBetweenClassAndTypeParameter.kt") + public void testSmartcastBetweenClassAndTypeParameter() { + runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastBetweenClassAndTypeParameter.kt"); + } + @Test @TestMetadata("smartcastInFriendModule.kt") public void testSmartcastInFriendModule() { @@ -36082,6 +36172,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/smartCasts/smartcastToStarProjection.kt"); } + @Test + @TestMetadata("syntheticAccessorOnSmartcastedReceiver.kt") + public void testSyntheticAccessorOnSmartcastedReceiver() { + runTest("compiler/testData/diagnostics/tests/smartCasts/syntheticAccessorOnSmartcastedReceiver.kt"); + } + @Test @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() { @@ -37405,6 +37501,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt"); } + @Test + @TestMetadata("propertyOfLocalClass.kt") + public void testPropertyOfLocalClass() { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/propertyOfLocalClass.kt"); + } + @Test @TestMetadata("propertySubtype.kt") public void testPropertySubtype() { @@ -41967,6 +42069,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt"); } + @Test + @TestMetadata("unnamedSubject.kt") + public void testUnnamedSubject() { + runTest("compiler/testData/diagnostics/tests/when/withSubjectVariable/unnamedSubject.kt"); + } + @Test @TestMetadata("unsupportedFeature.kt") public void testUnsupportedFeature() { @@ -44027,6 +44135,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt"); } + @Test + @TestMetadata("smartcastOnReceiverInComplexCondition.kt") + public void testSmartcastOnReceiverInComplexCondition() { + runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/smartcastOnReceiverInComplexCondition.kt"); + } + @Test @TestMetadata("throwsEffect.kt") public void testThrowsEffect() { @@ -44969,6 +45083,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); } + @Test + @TestMetadata("callableReference.kt") + public void testCallableReference() { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/callableReference.kt"); + } + @Test @TestMetadata("extensions.kt") public void testExtensions() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java index 4e22e646aa6..283e3c33175 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java @@ -22643,6 +22643,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 75d1c5706ad..925a23dc55e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -22719,6 +22719,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -34419,6 +34425,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 2d224aa09a9..ab4bc738638 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -22643,6 +22643,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 891a64d4dba..1ab85b04383 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -22643,6 +22643,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java index 0db9e9c5134..597bfebc3b1 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java @@ -22643,6 +22643,12 @@ public class FirBlackBoxCodegenTestWithInlineScopesGenerated extends AbstractFir runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @Test + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() { @@ -23943,6 +23949,12 @@ public class FirBlackBoxCodegenTestWithInlineScopesGenerated extends AbstractFir runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -36357,6 +36369,12 @@ public class FirBlackBoxCodegenTestWithInlineScopesGenerated extends AbstractFir KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index 3f7a911f64e..c5c26cd4af7 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -4704,6 +4704,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest runTest("compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt"); } + @Test + @TestMetadata("inferenceOfDefinitelyNotNullableBoolean.kt") + public void testInferenceOfDefinitelyNotNullableBoolean() { + runTest("compiler/testData/ir/irText/types/inferenceOfDefinitelyNotNullableBoolean.kt"); + } + @Test @TestMetadata("intersectionType1.kt") public void testIntersectionType1() { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 0dc9571b64a..26ef927651a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -18945,6 +18945,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/functions/kt873.kt"); } + @TestMetadata("lambdaWithTwoContextReceivers.kt") + public void testLambdaWithTwoContextReceivers() { + runTest("compiler/testData/codegen/box/functions/lambdaWithTwoContextReceivers.kt"); + } + @TestMetadata("localFunction.kt") public void testLocalFunction() { runTest("compiler/testData/codegen/box/functions/localFunction.kt"); @@ -20061,6 +20066,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { runTest("compiler/testData/codegen/box/inference/specialCallsWithCallableReferences.kt"); @@ -30962,6 +30972,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @TestMetadata("lambda1.kt") public void testLambda1() { runTest("compiler/testData/codegen/box/lambda/lambda1.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index c79cf0b8b09..0d44a6b0a8f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -18189,6 +18189,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -25869,6 +25875,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index 9d25637cd46..8199da6e72a 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -18189,6 +18189,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -25869,6 +25875,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index f3e47e2714a..175fc7b54dd 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -18189,6 +18189,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -25869,6 +25875,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 07e232af3e6..d76685dbd18 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -18189,6 +18189,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -25869,6 +25875,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java index 83aa375c1ff..a7e25bcee5e 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java @@ -19466,6 +19466,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -28853,6 +28859,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java index 7d9c6ca0305..ce2d4ac91b3 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java @@ -19888,6 +19888,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -29479,6 +29485,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java index 2093c7344e0..1c2f4e460d4 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java @@ -19044,6 +19044,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -28227,6 +28233,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java index 7cbdddecaf3..3c94c745062 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java @@ -19467,6 +19467,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -28854,6 +28860,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java index aeadbd83545..3641dc950ec 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java @@ -18225,6 +18225,12 @@ public class FirWasmJsCodegenBoxTestGenerated extends AbstractFirWasmJsCodegenBo runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -25839,6 +25845,12 @@ public class FirWasmJsCodegenBoxTestGenerated extends AbstractFirWasmJsCodegenBo KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index ab42d7ed61d..f1bf5999e84 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -18225,6 +18225,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt"); } + @Test + @TestMetadata("safeCastWithElvis.kt") + public void testSafeCastWithElvis() { + runTest("compiler/testData/codegen/box/inference/safeCastWithElvis.kt"); + } + @Test @TestMetadata("specialCallsWithCallableReferences.kt") public void testSpecialCallsWithCallableReferences() { @@ -25839,6 +25845,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/lambda"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @Test + @TestMetadata("ifWithReferenceAndLambda.kt") + public void testIfWithReferenceAndLambda() { + runTest("compiler/testData/codegen/box/lambda/ifWithReferenceAndLambda.kt"); + } + @Test @TestMetadata("lambda1.kt") public void testLambda1() {