Use type substitution when matching header-impl members
Previously, type substitution, which is critical for matching generic header/impl members with each other, was only performed when checkImplementationHasHeaderDeclaration was called for impl class (areCompatibleClassifiers creates the correct substitutor). This was done in areCompatibleClassifiers: a substitutor which maps type parameters of the header class to type parameters of the impl class was created. Now we create the same substitutor when checkImplementationHasHeaderDeclaration is called for an impl member of an impl class as well, manually. #KT-15230 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
header interface A<T> {
|
||||
val x: T
|
||||
var y: List<T>
|
||||
fun f(p: Collection<T>): Map<T, A<T?>>
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
impl interface A<T> {
|
||||
impl val x: T
|
||||
impl var y: List<T>
|
||||
impl fun f(p: Collection<T>): Map<T, A<T?>>
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// -- Module: <m1-common> --
|
||||
package
|
||||
|
||||
public header interface A</*0*/ T> {
|
||||
public header abstract val x: T
|
||||
public header abstract var y: kotlin.collections.List<T>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract header fun f(/*0*/ p: kotlin.collections.Collection<T>): kotlin.collections.Map<T, A<T?>>
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <m2-jvm> --
|
||||
package
|
||||
|
||||
public impl interface A</*0*/ T> {
|
||||
public impl abstract val x: T
|
||||
public impl abstract var y: kotlin.collections.List<T>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract impl fun f(/*0*/ p: kotlin.collections.Collection<T>): kotlin.collections.Map<T, A<T?>>
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user