Allow Result as a return type if one enabled inline classes explicitly
#KT-38042 Fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
fun foo() = Result.success(42)
|
||||
@@ -0,0 +1,5 @@
|
||||
$TESTDATA_DIR$/resultInReturnType.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-language-version
|
||||
1.4
|
||||
@@ -0,0 +1,4 @@
|
||||
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
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/resultInReturnType.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xinline-classes
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/resultInReturnType.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-XXLanguage\:+InlineClasses
|
||||
@@ -0,0 +1,10 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:+InlineClasses
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user