Fix wrong contract assumption
Currently SamAdapterOverridabilityCondition can be called even for incompatible descriptors #KT-10486 Fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package test;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
public final class DifferentParametersCount {
|
||||
public static class A {
|
||||
static public void foo(Runnable x, int y) {}
|
||||
}
|
||||
|
||||
public static class B extends A {
|
||||
// SAM adapter should not override A.foo
|
||||
static public void foo(Runnable x) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package test
|
||||
|
||||
public final class DifferentParametersCount {
|
||||
public constructor DifferentParametersCount()
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
public open fun foo(/*0*/ p0: java.lang.Runnable!, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class B : test.DifferentParametersCount.A {
|
||||
public constructor B()
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
public open fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: java.lang.Runnable!, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user