Report error if fun interface method has JVM name getFunctionDelegate
This is needed so that it wouldn't clash with the corresponding member from the kotlin/jvm/internal/FunctionAdapter interface, which all fun interface wrappers will implement to get proper equals/hashCode. The workaround is to rename the fun interface method. #KT-33455
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface F1 {
|
||||
val functionDelegate: Function<*>? get() = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F2 {
|
||||
fun getFunctionDelegate(): Function<*>? = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F3 {
|
||||
val getFunctionDelegate: Function<*>? get() = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F4 {
|
||||
fun functionDelegate(): Function<*>? = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F5 {
|
||||
val functionDelegate: Any? get() = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F6 {
|
||||
val String.functionDelegate: Function<*>? get() = null
|
||||
fun getFunctionDelegate(x: Any?): Function<*>? = null
|
||||
fun invoke()
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface F1 {
|
||||
val <!FUNCTION_DELEGATE_MEMBER_NAME_CLASH!>functionDelegate<!>: Function<*>? get() = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F2 {
|
||||
fun <!FUNCTION_DELEGATE_MEMBER_NAME_CLASH!>getFunctionDelegate<!>(): Function<*>? = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F3 {
|
||||
val getFunctionDelegate: Function<*>? get() = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F4 {
|
||||
fun functionDelegate(): Function<*>? = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F5 {
|
||||
val <!FUNCTION_DELEGATE_MEMBER_NAME_CLASH!>functionDelegate<!>: Any? get() = null
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface F6 {
|
||||
val String.functionDelegate: Function<*>? get() = null
|
||||
fun getFunctionDelegate(x: Any?): Function<*>? = null
|
||||
fun invoke()
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package
|
||||
|
||||
public fun interface F1 {
|
||||
public open val functionDelegate: kotlin.Function<*>?
|
||||
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 F2 {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getFunctionDelegate(): kotlin.Function<*>?
|
||||
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 F3 {
|
||||
public open val getFunctionDelegate: kotlin.Function<*>?
|
||||
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 F4 {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun functionDelegate(): kotlin.Function<*>?
|
||||
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 F5 {
|
||||
public open val functionDelegate: kotlin.Any?
|
||||
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 F6 {
|
||||
public open val kotlin.String.functionDelegate: kotlin.Function<*>?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getFunctionDelegate(/*0*/ x: kotlin.Any?): kotlin.Function<*>?
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user