Allow Result as a return type if one enabled inline classes explicitly

#KT-38042 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-04-07 01:25:55 +03:00
parent 1ffdc11d31
commit 73e1ddc505
9 changed files with 45 additions and 1 deletions
+1
View File
@@ -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