From 8bfc4675c4ca59e5a66bf6edbd0bb98f622c6d59 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Mon, 8 Jan 2024 10:00:16 +0100 Subject: [PATCH] [FIR] Fix parameter order of NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS --- .../analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt | 2 +- compiler/testData/cli/jvm/jspecifyDefault.out | 2 +- compiler/testData/cli/jvm/jspecifyWarn.out | 2 +- compiler/testData/cli/jvm/jsr305DeprecatedWarn.out | 2 +- compiler/testData/cli/jvm/jsr305MigrationFqNameIgnore.out | 2 +- compiler/testData/cli/jvm/jsr305MigrationIgnore.out | 2 +- compiler/testData/cli/jvm/jsr305MigrationWarn.out | 4 ++-- compiler/testData/cli/jvm/jsr305NoFlag.out | 2 +- compiler/testData/cli/jvm/jsr305Warn.out | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt b/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt index 0bcad30ea3c..ad8e13a99a8 100644 --- a/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt +++ b/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt @@ -95,7 +95,7 @@ object FirJvmErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put( NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS, - "Java type mismatch: inferred type is ''{1}'', but ''{0}'' was expected.{2}", + "Java type mismatch: inferred type is ''{0}'', but ''{1}'' was expected.{2}", RENDER_TYPE, RENDER_TYPE, OPTIONAL_SENTENCE, diff --git a/compiler/testData/cli/jvm/jspecifyDefault.out b/compiler/testData/cli/jvm/jspecifyDefault.out index 0f9b54c5d8e..7f7a58896f3 100644 --- a/compiler/testData/cli/jvm/jspecifyDefault.out +++ b/compiler/testData/cli/jvm/jspecifyDefault.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. a.foo(null) ^ compiler/testData/cli/jvm/jspecifyUsage.kt:3:5: warning: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.String?'. diff --git a/compiler/testData/cli/jvm/jspecifyWarn.out b/compiler/testData/cli/jvm/jspecifyWarn.out index 0f9b54c5d8e..7f7a58896f3 100644 --- a/compiler/testData/cli/jvm/jspecifyWarn.out +++ b/compiler/testData/cli/jvm/jspecifyWarn.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. a.foo(null) ^ compiler/testData/cli/jvm/jspecifyUsage.kt:3:5: warning: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.String?'. diff --git a/compiler/testData/cli/jvm/jsr305DeprecatedWarn.out b/compiler/testData/cli/jvm/jsr305DeprecatedWarn.out index e19f716a0ef..89d4681c329 100644 --- a/compiler/testData/cli/jvm/jsr305DeprecatedWarn.out +++ b/compiler/testData/cli/jvm/jsr305DeprecatedWarn.out @@ -1,5 +1,5 @@ warning: argument -Xjsr305-annotations is deprecated. Please use -Xjsr305 instead -compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. a.foo(null) ^ OK diff --git a/compiler/testData/cli/jvm/jsr305MigrationFqNameIgnore.out b/compiler/testData/cli/jvm/jsr305MigrationFqNameIgnore.out index 2ebcc2c26cd..a14ffd95130 100644 --- a/compiler/testData/cli/jvm/jsr305MigrationFqNameIgnore.out +++ b/compiler/testData/cli/jvm/jsr305MigrationFqNameIgnore.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Migration.kt:2:19: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Migration.kt:2:19: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. annotated.foo(null) ^ compiler/testData/cli/jvm/jsr305Migration.kt:4:5: warning: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.String?'. diff --git a/compiler/testData/cli/jvm/jsr305MigrationIgnore.out b/compiler/testData/cli/jvm/jsr305MigrationIgnore.out index 2ebcc2c26cd..a14ffd95130 100644 --- a/compiler/testData/cli/jvm/jsr305MigrationIgnore.out +++ b/compiler/testData/cli/jvm/jsr305MigrationIgnore.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Migration.kt:2:19: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Migration.kt:2:19: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. annotated.foo(null) ^ compiler/testData/cli/jvm/jsr305Migration.kt:4:5: warning: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.String?'. diff --git a/compiler/testData/cli/jvm/jsr305MigrationWarn.out b/compiler/testData/cli/jvm/jsr305MigrationWarn.out index 02950901a99..90f5472f8e4 100644 --- a/compiler/testData/cli/jvm/jsr305MigrationWarn.out +++ b/compiler/testData/cli/jvm/jsr305MigrationWarn.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/jsr305Migration.kt:2:19: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Migration.kt:2:19: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. annotated.foo(null) ^ -compiler/testData/cli/jvm/jsr305Migration.kt:3:19: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Migration.kt:3:19: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. annotated.bar(null) ^ compiler/testData/cli/jvm/jsr305Migration.kt:4:5: warning: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.String?'. diff --git a/compiler/testData/cli/jvm/jsr305NoFlag.out b/compiler/testData/cli/jvm/jsr305NoFlag.out index 7e9c02d1167..615613ace29 100644 --- a/compiler/testData/cli/jvm/jsr305NoFlag.out +++ b/compiler/testData/cli/jvm/jsr305NoFlag.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. a.foo(null) ^ OK diff --git a/compiler/testData/cli/jvm/jsr305Warn.out b/compiler/testData/cli/jvm/jsr305Warn.out index 7e9c02d1167..615613ace29 100644 --- a/compiler/testData/cli/jvm/jsr305Warn.out +++ b/compiler/testData/cli/jvm/jsr305Warn.out @@ -1,4 +1,4 @@ -compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.String', but 'kotlin.Nothing?' was expected. +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: Java type mismatch: inferred type is 'kotlin.Nothing?', but 'kotlin.String' was expected. a.foo(null) ^ OK