Add test checking that fun isn't inherited from base interface
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface Base {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
interface WithoutFun : Base
|
||||
fun interface WithFun : Base
|
||||
|
||||
fun takeBase(b: Base) {}
|
||||
fun takeWithoutFun(a: WithoutFun) {}
|
||||
fun takeWithFun(a: WithFun) {}
|
||||
|
||||
fun test() {
|
||||
takeBase {}
|
||||
takeWithoutFun({})
|
||||
takeWithFun {}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface Base {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
interface WithoutFun : Base
|
||||
fun interface WithFun : Base
|
||||
|
||||
fun takeBase(b: Base) {}
|
||||
fun takeWithoutFun(a: WithoutFun) {}
|
||||
fun takeWithFun(a: WithFun) {}
|
||||
|
||||
fun test() {
|
||||
takeBase {}
|
||||
takeWithoutFun(<!TYPE_MISMATCH!>{}<!>)
|
||||
takeWithFun {}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package
|
||||
|
||||
public fun takeBase(/*0*/ b: Base): kotlin.Unit
|
||||
public fun takeWithFun(/*0*/ a: WithFun): kotlin.Unit
|
||||
public fun takeWithoutFun(/*0*/ a: WithoutFun): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public fun interface Base {
|
||||
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 fun interface WithFun : Base {
|
||||
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 override /*1*/ /*fake_override*/ fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface WithoutFun : Base {
|
||||
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 override /*1*/ /*fake_override*/ fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user