[NI] Move ability to convert standalone SAM-argument under the feature
If new inference is enabled only for IDE analysis, then this feature will be disabled to reduce difference between new and old inference, but if new inference is enabled in the compiler, then this feature will be enabled too to preserve behavior of new inference for compilation #KT-32175 Fixed #KT-32143 Fixed #KT-32123 Fixed #KT-32230 Fixed
This commit is contained in:
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/standaloneSamConversionsAreEnabledWithNewInference.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xnew-inference -XXLanguage:-SamConversionPerArgument
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
warning: flag is not supported by this version of the compiler: -Xnew-inference -XXLanguage:-SamConversionPerArgument
|
||||
compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:9:25: error: type mismatch: inferred type is () -> Unit but Runnable was expected
|
||||
ForceSam.compare(r, {})
|
||||
^
|
||||
compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:10:22: error: type mismatch: inferred type is () -> Unit but Runnable was expected
|
||||
ForceSam.compare({}, r)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/standaloneSamConversionsAreEnabledWithNewInference.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xnew-inference
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
object ForceSam : java.util.Comparator<Runnable> {
|
||||
override fun compare(o1: Runnable, o2: Runnable): Int = 0
|
||||
}
|
||||
|
||||
fun test(r: Runnable) {
|
||||
ForceSam.compare(r, r)
|
||||
ForceSam.compare({}, {})
|
||||
|
||||
ForceSam.compare(r, {})
|
||||
ForceSam.compare({}, r)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
OK
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/standaloneSamConversionsAreEnabledWithNewInference.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-XXLanguage:+NewInference
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
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!
|
||||
|
||||
OK
|
||||
@@ -0,0 +1,3 @@
|
||||
$TESTDATA_DIR$/standaloneSamConversionsAreEnabledWithNewInference.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1,7 @@
|
||||
compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:9:25: error: type mismatch: inferred type is () -> Unit but Runnable was expected
|
||||
ForceSam.compare(r, {})
|
||||
^
|
||||
compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:10:22: error: type mismatch: inferred type is () -> Unit but Runnable was expected
|
||||
ForceSam.compare({}, r)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
Reference in New Issue
Block a user