[FIR] KT-57655: Add the missing branch ^KT-57655 Fixed
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 0bed2cb..a599c0c 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
@@ -33914,6 +33914,12 @@ } @Test + @TestMetadata("implicitIntegerCoercionNamedArg.kt") + public void testImplicitIntegerCoercionNamedArg() throws Exception { + runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt"); + } + + @Test @TestMetadata("inferenceForSignedAndUnsignedTypes.kt") public void testInferenceForSignedAndUnsignedTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt");
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 e37a6dd..1e08bea 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
@@ -33914,6 +33914,12 @@ } @Test + @TestMetadata("implicitIntegerCoercionNamedArg.kt") + public void testImplicitIntegerCoercionNamedArg() throws Exception { + runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt"); + } + + @Test @TestMetadata("inferenceForSignedAndUnsignedTypes.kt") public void testInferenceForSignedAndUnsignedTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt");
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 a101d9d..1dc342b 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
@@ -33914,6 +33914,12 @@ } @Test + @TestMetadata("implicitIntegerCoercionNamedArg.kt") + public void testImplicitIntegerCoercionNamedArg() throws Exception { + runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt"); + } + + @Test @TestMetadata("inferenceForSignedAndUnsignedTypes.kt") public void testInferenceForSignedAndUnsignedTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt");
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 a01a726..55b5807 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
@@ -34010,6 +34010,12 @@ } @Test + @TestMetadata("implicitIntegerCoercionNamedArg.kt") + public void testImplicitIntegerCoercionNamedArg() throws Exception { + runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt"); + } + + @Test @TestMetadata("inferenceForSignedAndUnsignedTypes.kt") public void testInferenceForSignedAndUnsignedTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt");
diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt index 9669f2e..6c1ba36 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt
@@ -593,6 +593,7 @@ || kind == ConstantValueKind.UnsignedIntegerLiteral is FirIntegerLiteralOperatorCall -> true + is FirNamedArgumentExpression -> this.expression.isIntegerLiteralOrOperatorCall() else -> false } }
diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt new file mode 100644 index 0000000..6b5f20c --- /dev/null +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt
@@ -0,0 +1,21 @@ +// FIR_IDENTICAL +// ISSUE: KT-57655 +// !LANGUAGE: +ImplicitSignedToUnsignedIntegerConversion +// ALLOW_KOTLIN_PACKAGE + +// FILE: annotation.kt + +package kotlin.internal + +annotation class ImplicitIntegerCoercion + +// FILE: test.kt + +import kotlin.internal.ImplicitIntegerCoercion + +fun test(@ImplicitIntegerCoercion x: UInt) = x + +fun main() { + println(test(x = 5)) + println(test(5)) +}
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 e2565b3..e9a7fa1 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
@@ -34776,6 +34776,12 @@ } @Test + @TestMetadata("implicitIntegerCoercionNamedArg.kt") + public void testImplicitIntegerCoercionNamedArg() throws Exception { + runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/implicitIntegerCoercionNamedArg.kt"); + } + + @Test @TestMetadata("inferenceForSignedAndUnsignedTypes.kt") public void testInferenceForSignedAndUnsignedTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt");