[NI] Don't use only platform specific checks for FIC in inference

This commit is contained in:
Mikhail Zarechenskiy
2020-01-24 20:09:35 +03:00
parent 7e85674c61
commit 00469712d1
14 changed files with 220 additions and 67 deletions
+15
View File
@@ -0,0 +1,15 @@
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+NewInference
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+SamConversionForKotlinFunctions
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+SamConversionPerArgument
package common
fun interface KRunnable {
fun invoke(): String
}
fun foo(k: KRunnable) = k.invoke()
fun test() {
foo { "OK" }
}
+15
View File
@@ -0,0 +1,15 @@
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+NewInference
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+SamConversionForKotlinFunctions
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+SamConversionPerArgument
package js
fun interface KRunnable {
fun invoke(): String
}
fun foo(k: KRunnable) = k.invoke()
fun test() {
foo { "OK" }
}
+15
View File
@@ -0,0 +1,15 @@
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+NewInference
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+SamConversionForKotlinFunctions
// ADDITIONAL_COMPILER_ARGUMENTS: -XXLanguage:+SamConversionPerArgument
package jvm
fun interface KRunnable {
fun invoke(): String
}
fun foo(k: KRunnable) = k.invoke()
fun test() {
foo { "OK" }
}
@@ -0,0 +1,41 @@
-- Common --
Exit code: OK
Output:
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+NewInference
-XXLanguage:+SamConversionForKotlinFunctions
-XXLanguage:+SamConversionPerArgument
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!
-- JVM --
Exit code: OK
Output:
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+NewInference
-XXLanguage:+SamConversionForKotlinFunctions
-XXLanguage:+SamConversionPerArgument
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!
-- JS --
Exit code: OK
Output:
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+NewInference
-XXLanguage:+SamConversionForKotlinFunctions
-XXLanguage:+SamConversionPerArgument
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!