Disable AllowResultInReturnType feature
#KT-40843
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -7,4 +7,7 @@ This mode is not recommended for production use,
|
|||||||
as no stability/compatibility guarantees are given on
|
as no stability/compatibility guarantees are given on
|
||||||
compiler or generated code. Use it at your own risk!
|
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
|
||||||
|
|||||||
+3
-3
@@ -16,15 +16,15 @@ fun baz(r: Result<Int>) {}
|
|||||||
fun returnsInlineClass() = Foo(1)
|
fun returnsInlineClass() = Foo(1)
|
||||||
|
|
||||||
@JvmName("test")
|
@JvmName("test")
|
||||||
fun returnsKotlinResult(a: Result<Int>): Result<Int> = a
|
fun returnsKotlinResult(a: Result<Int>): <!RESULT_CLASS_IN_RETURN_TYPE!>Result<Int><!> = a
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
<!INAPPLICABLE_JVM_NAME!>@JvmName("test")<!>
|
<!INAPPLICABLE_JVM_NAME!>@JvmName("test")<!>
|
||||||
fun returnsInlineClass() = Foo(1)
|
fun returnsInlineClass() = Foo(1)
|
||||||
|
|
||||||
<!INAPPLICABLE_JVM_NAME!>@JvmName("test")<!>
|
<!INAPPLICABLE_JVM_NAME!>@JvmName("test")<!>
|
||||||
fun returnsKotlinResult(a: Result<Int>): Result<Int> = a
|
fun returnsKotlinResult(a: Result<Int>): <!RESULT_CLASS_IN_RETURN_TYPE!>Result<Int><!> = a
|
||||||
}
|
}
|
||||||
|
|
||||||
<!INAPPLICABLE_JVM_NAME!>@JvmName("extensionFun")<!>
|
<!INAPPLICABLE_JVM_NAME!>@JvmName("extensionFun")<!>
|
||||||
fun Foo.extensionFun() {}
|
fun Foo.extensionFun() {}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ enum class LanguageFeature(
|
|||||||
ProperFinally(KOTLIN_1_4, kind = BUG_FIX),
|
ProperFinally(KOTLIN_1_4, kind = BUG_FIX),
|
||||||
AllowAssigningArrayElementsToVarargsInNamedFormForFunctions(KOTLIN_1_4),
|
AllowAssigningArrayElementsToVarargsInNamedFormForFunctions(KOTLIN_1_4),
|
||||||
AllowNullOperatorsForResult(KOTLIN_1_4),
|
AllowNullOperatorsForResult(KOTLIN_1_4),
|
||||||
AllowResultInReturnType(KOTLIN_1_4),
|
AllowResultInReturnType(KOTLIN_1_4, defaultState = State.DISABLED),
|
||||||
PreferJavaFieldOverload(KOTLIN_1_4),
|
PreferJavaFieldOverload(KOTLIN_1_4),
|
||||||
AllowContractsForNonOverridableMembers(KOTLIN_1_4),
|
AllowContractsForNonOverridableMembers(KOTLIN_1_4),
|
||||||
AllowReifiedGenericsInContracts(KOTLIN_1_4),
|
AllowReifiedGenericsInContracts(KOTLIN_1_4),
|
||||||
|
|||||||
Reference in New Issue
Block a user