Add compatibility warning for chained sam->suspend-conversion
This commit is contained in:
+1
-1
@@ -9,5 +9,5 @@ fun foo(s: SuspendRunnable) {}
|
||||
|
||||
fun test(f: () -> Unit) {
|
||||
foo { }
|
||||
foo(<!TYPE_MISMATCH!>f<!>)
|
||||
foo(f)
|
||||
}
|
||||
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// !LANGUAGE: -SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
}
|
||||
|
||||
object Test1 {
|
||||
fun call(r: () -> Unit) {}
|
||||
|
||||
object Scope {
|
||||
fun call(r: SuspendRunnable) {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
<!DEBUG_INFO_CALL("fqName: Test1.call; typeCall: function")!>call(f)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object Test2 {
|
||||
fun call(r: Runnable) {}
|
||||
|
||||
object Scope {
|
||||
fun call(r: SuspendRunnable) {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
<!DEBUG_INFO_CALL("fqName: Test2.call; typeCall: function")!>call(f)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// !LANGUAGE: -SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
}
|
||||
|
||||
object Test1 {
|
||||
fun call(r: () -> Unit) {}
|
||||
|
||||
object Scope {
|
||||
fun call(r: SuspendRunnable) {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
<!COMPATIBILITY_WARNING, DEBUG_INFO_CALL("fqName: Test1.call; typeCall: function")!>call(f)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object Test2 {
|
||||
fun call(r: Runnable) {}
|
||||
|
||||
object Scope {
|
||||
fun call(r: SuspendRunnable) {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
<!DEBUG_INFO_CALL("fqName: Test2.Scope.call; typeCall: function")!>call(<!UNSUPPORTED_FEATURE!>f<!>)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
package
|
||||
|
||||
public fun interface SuspendRunnable {
|
||||
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 suspend fun run(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public object Test1 {
|
||||
private constructor Test1()
|
||||
public final fun call(/*0*/ r: () -> kotlin.Unit): kotlin.Unit
|
||||
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public object Scope {
|
||||
private constructor Scope()
|
||||
public final fun bar(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
|
||||
public final fun call(/*0*/ r: SuspendRunnable): kotlin.Unit
|
||||
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public object Test2 {
|
||||
private constructor Test2()
|
||||
public final fun call(/*0*/ r: java.lang.Runnable): kotlin.Unit
|
||||
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public object Scope {
|
||||
private constructor Scope()
|
||||
public final fun bar(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
|
||||
public final fun call(/*0*/ r: SuspendRunnable): kotlin.Unit
|
||||
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user