Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
$TESTDATA_DIR$/newInferenceImpliesSamConversions.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xnew-inference
|
||||
-XXLanguage\:-SamConversionForKotlinFunctions
|
||||
@@ -0,0 +1,13 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:-SamConversionForKotlinFunctions
|
||||
|
||||
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!
|
||||
|
||||
compiler/testData/cli/jvm/newInferenceImpliesSamConversions.kt:4:9: error: type mismatch: inferred type is () -> TypeVariable(_L) but Runnable was expected
|
||||
foo { }
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,5 @@
|
||||
$TESTDATA_DIR$/newInferenceImpliesSamConversions.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-XXLanguage\:+NewInference
|
||||
-XXLanguage\:-SamConversionForKotlinFunctions
|
||||
@@ -0,0 +1,14 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:+NewInference
|
||||
-XXLanguage:-SamConversionForKotlinFunctions
|
||||
|
||||
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!
|
||||
|
||||
compiler/testData/cli/jvm/newInferenceImpliesSamConversions.kt:4:9: error: type mismatch: inferred type is () -> TypeVariable(_L) but Runnable was expected
|
||||
foo { }
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/newInferenceImpliesSamConversions.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-XXLanguage\:+NewInference
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(r: Runnable) {}
|
||||
|
||||
fun test() {
|
||||
foo { }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:+NewInference
|
||||
|
||||
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!
|
||||
|
||||
compiler/testData/cli/jvm/newInferenceImpliesSamConversions.kt:1:9: warning: parameter 'r' is never used
|
||||
fun foo(r: Runnable) {}
|
||||
^
|
||||
OK
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/newInferenceImpliesSamConversions.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xnew-inference
|
||||
@@ -0,0 +1,4 @@
|
||||
compiler/testData/cli/jvm/newInferenceImpliesSamConversions.kt:1:9: warning: parameter 'r' is never used
|
||||
fun foo(r: Runnable) {}
|
||||
^
|
||||
OK
|
||||
Reference in New Issue
Block a user