diff --git a/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClasses.out b/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClasses.out index d86bac9de59..0e1d610cb16 100644 --- a/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClasses.out +++ b/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClasses.out @@ -1 +1,4 @@ -OK +compiler/testData/cli/jvm/resultInReturnType.kt:1:5: error: 'kotlin.Result' cannot be used as a return type +fun foo() = Result.success(42) + ^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClassesXX.out b/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClassesXX.out index 9ac07a0980f..53990cf80e6 100644 --- a/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClassesXX.out +++ b/compiler/testData/cli/jvm/resultInReturnTypeWithEnabledInlineClassesXX.out @@ -7,4 +7,7 @@ This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! -OK +compiler/testData/cli/jvm/resultInReturnType.kt:1:5: error: 'kotlin.Result' cannot be used as a return type +fun foo() = Result.success(42) + ^ +COMPILATION_ERROR diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmNameOnMangledNames.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmNameOnMangledNames.kt index b58fac74635..2422426f648 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmNameOnMangledNames.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmNameOnMangledNames.kt @@ -16,15 +16,15 @@ fun baz(r: Result) {} fun returnsInlineClass() = Foo(1) @JvmName("test") -fun returnsKotlinResult(a: Result): Result = a +fun returnsKotlinResult(a: Result): Result = a class C { @JvmName("test") fun returnsInlineClass() = Foo(1) @JvmName("test") - fun returnsKotlinResult(a: Result): Result = a + fun returnsKotlinResult(a: Result): Result = a } @JvmName("extensionFun") -fun Foo.extensionFun() {} \ No newline at end of file +fun Foo.extensionFun() {} diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 84f8d7ca0bc..ab0ec7d6642 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -115,7 +115,7 @@ enum class LanguageFeature( ProperFinally(KOTLIN_1_4, kind = BUG_FIX), AllowAssigningArrayElementsToVarargsInNamedFormForFunctions(KOTLIN_1_4), AllowNullOperatorsForResult(KOTLIN_1_4), - AllowResultInReturnType(KOTLIN_1_4), + AllowResultInReturnType(KOTLIN_1_4, defaultState = State.DISABLED), PreferJavaFieldOverload(KOTLIN_1_4), AllowContractsForNonOverridableMembers(KOTLIN_1_4), AllowReifiedGenericsInContracts(KOTLIN_1_4),