FIC: Add synthetic constructors for fun interfaces aka explicit FIC

This commit is contained in:
Mikhail Zarechenskiy
2019-11-15 13:07:18 +03:00
parent 0f242a9931
commit fc32e8b017
9 changed files with 66 additions and 17 deletions
@@ -0,0 +1,15 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionInterfaceConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun interface KRunnable {
fun invoke()
}
typealias KRunnableAlias = KRunnable
fun foo(f: KRunnable) {}
fun test() {
foo(KRunnable {})
foo(KRunnableAlias {})
}
@@ -0,0 +1,12 @@
package
public fun foo(/*0*/ f: KRunnable): kotlin.Unit
public fun test(): kotlin.Unit
public interface KRunnable {
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 invoke(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public typealias KRunnableAlias = KRunnable