diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt index c07319a2e6c..426e9d0c7f6 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt @@ -2018,7 +2018,8 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND_FUN, - "Calls having a form of ''suspend fun'' are deprecated because ''suspend'' in the context will have a meaning of a modifier. Surround the argument of the call with parens: ''suspend(fun() { ... })''" + "Calls having a form of ''suspend fun'' are deprecated because ''suspend'' in the context will have a meaning of a modifier. Surround the argument of the call with parens: ''suspend(fun() { ... })''." + + " See https://youtrack.jetbrains.com/issue/KT-49264" ) map.put(RETURN_FOR_BUILT_IN_SUSPEND, "Using implicit label for this lambda is prohibited") diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index f5e643931bd..ec975df421d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -1114,7 +1114,10 @@ public class DefaultErrorMessages { MAP.put(IMPLICIT_NOTHING_TYPE_ARGUMENT_AGAINST_NOT_NOTHING_EXPECTED_TYPE, "Returning type parameter has been inferred to Nothing implicitly because Nothing is more specific than specified expected type. Please specify type arguments explicitly in accordance with expected type to hide this warning. Nothing can produce an exception at runtime. See KT-36776 for more details."); MAP.put(RETURN_FOR_BUILT_IN_SUSPEND, "Using implicit label for this lambda is prohibited"); MAP.put(MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND, "Calls having a form of ''suspend {}'' are deprecated because ''suspend'' in the context will have a meaning of a modifier. Add empty argument list to the call: ''suspend() { ... }''"); - MAP.put(MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND_FUN, "Calls having a form of ''suspend fun'' are deprecated because ''suspend'' in the context will have a meaning of a modifier. Surround the argument of the call with parens: ''suspend(fun() { ... })''"); + MAP.put(MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND_FUN, + "Calls having a form of ''suspend fun'' are deprecated because ''suspend'' in the context will have a meaning of a modifier. Surround the argument of the call with parens: ''suspend(fun() { ... })''." + + " See https://youtrack.jetbrains.com/issue/KT-49264" + ); MAP.put(PLUGIN_ERROR, "{0}", (d, c) -> d.getText()); MAP.put(PLUGIN_WARNING, "{0}", (d, c) -> d.getText()); diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInWithFun.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInWithFun.kt index 5e39df19fa0..7aa35dbe217 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInWithFun.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInWithFun.kt @@ -4,7 +4,7 @@ infix fun Int.suspend(c: () -> Unit) { c() } fun bar() { - 1 suspend fun() { + 1 suspend fun() { println() } @@ -12,7 +12,7 @@ fun bar() { println() } - 1 suspend @Ann fun() { + 1 suspend @Ann fun() { println() } } @@ -22,7 +22,7 @@ fun bar() { annotation class Ann fun main(suspend: WLambdaInvoke) { - 1 suspend fun() {} + 1 suspend fun() {} } class WLambdaInvoke { diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 83ac1e0ca9b..ee680ed9d54 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -256,7 +256,6 @@ enum class LanguageFeature( ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes(KOTLIN_1_8, kind = BUG_FIX), // KT-29168 IgnoreNullabilityForErasedValueParameters(KOTLIN_1_8, kind = BUG_FIX), ForbidUsingExtensionPropertyTypeParameterInDelegate(KOTLIN_1_8, kind = BUG_FIX), - ModifierNonBuiltinSuspendFunError(KOTLIN_1_8), SynchronizedSuspendError(KOTLIN_1_8), EnableDfaWarningsInK2(KOTLIN_1_8, kind = OTHER), // KT-50965 ReportNonVarargSpreadOnGenericCalls(KOTLIN_1_8, kind = BUG_FIX), // KT-48162 @@ -282,6 +281,7 @@ enum class LanguageFeature( ForbidExtensionCallsOnInlineFunctionalParameters(KOTLIN_1_9, kind = BUG_FIX), // KT-52502 ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound(KOTLIN_1_9, kind = BUG_FIX), // KT-47986 SkipStandaloneScriptsInSourceRoots(KOTLIN_1_9, kind = OTHER), // KT-52525 + ModifierNonBuiltinSuspendFunError(KOTLIN_1_9), // Disabled for indefinite time. See KT-48535 and related discussion ApproximateIntegerLiteralTypesInReceiverPosition(sinceVersion = null),