[FE 1.0] Make "Unit conversions" accessible experimental feature
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion +SuspendConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion +SuspendConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface KRunnable {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface KRunnable {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion +SuspendConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: suspend () -> Unit) {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion +SuspendConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: suspend () -> Unit) {}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
fun interface Run {
|
||||
fun run()
|
||||
}
|
||||
|
||||
fun handle(run: Run) {
|
||||
//...
|
||||
}
|
||||
|
||||
val x = {
|
||||
"STRING"
|
||||
}
|
||||
|
||||
fun test() {
|
||||
handle(<!ARGUMENT_TYPE_MISMATCH!>x<!>)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fun interface Run {
|
||||
fun run()
|
||||
}
|
||||
|
||||
fun handle(run: Run) {
|
||||
//...
|
||||
}
|
||||
|
||||
val x = {
|
||||
"STRING"
|
||||
}
|
||||
|
||||
fun test() {
|
||||
handle(<!UNSUPPORTED_FEATURE("The feature "unit conversions on arbitrary expressions" is experimental and should be enabled explicitly")!>x<!>)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public val x: () -> kotlin.String
|
||||
public fun handle(/*0*/ run: Run): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public fun interface Run {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract fun run(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: -UnitConversion
|
||||
// !LANGUAGE: -UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: () -> Unit) {}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: -UnitConversion
|
||||
// !LANGUAGE: -UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: () -> Unit) {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: () -> Unit) {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: () -> Unit) {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: (Int, String) -> Unit) {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !LANGUAGE: +UnitConversion
|
||||
// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun foo(f: (Int, String) -> Unit) {}
|
||||
|
||||
Reference in New Issue
Block a user