Fix substitutor for synthetic SAM adapters
When synthetic member comes not from the receiver type itself, but from one of its supertypes it doesn't make sense to subsitute the member with receiver type, we should obtain relevant supertype and use it instead. #KT-16578 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// FILE: FormFieldValidatorPresenterTest.java
|
||||
public class FormFieldValidatorPresenterTest<V extends String> {
|
||||
|
||||
public void setValidationListenerTest(ValidationListenerTest validationListener) {
|
||||
}
|
||||
|
||||
public interface ValidationListenerTest {
|
||||
void onValidityChanged(boolean valid);
|
||||
}
|
||||
}
|
||||
// FILE: main.kt
|
||||
fun <P : FormFieldValidatorPresenterTest<String>> setValidationListener(
|
||||
presenter: P,
|
||||
validationListener: (Boolean) -> Unit
|
||||
) {
|
||||
presenter.setValidationListenerTest(validationListener) // Error: Type mismatch: inferred type is (Boolean) -> Unit but FormFieldValidatorPresenterTest.ValidationListenerTest! was expected
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ P : FormFieldValidatorPresenterTest<kotlin.String>> setValidationListener(/*0*/ presenter: P, /*1*/ validationListener: (kotlin.Boolean) -> kotlin.Unit): kotlin.Unit
|
||||
|
||||
public open class FormFieldValidatorPresenterTest</*0*/ V : kotlin.String!> {
|
||||
public constructor FormFieldValidatorPresenterTest</*0*/ V : kotlin.String!>()
|
||||
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 fun setValidationListenerTest(/*0*/ validationListener: FormFieldValidatorPresenterTest.ValidationListenerTest!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public interface ValidationListenerTest {
|
||||
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 onValidityChanged(/*0*/ valid: kotlin.Boolean): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun ValidationListenerTest(/*0*/ function: (valid: kotlin.Boolean) -> kotlin.Unit): FormFieldValidatorPresenterTest.ValidationListenerTest
|
||||
}
|
||||
Reference in New Issue
Block a user