KT-59836 [SLC] Copy type parameters from the parent interface to DefaultImpls methods

This commit is contained in:
Pavel Mikhailovskii
2023-07-10 13:11:21 +00:00
committed by Space Team
parent ddb27f2b26
commit 6e6a4d6411
22 changed files with 146 additions and 10 deletions
@@ -0,0 +1,5 @@
interface Foo<X, Y> {
fun <Z> foo(x: X, y: Y, z: Z) {}
val x: Int get() = 0
}
@@ -0,0 +1,24 @@
@kotlin.Metadata()
public abstract interface Foo<X extends java.lang.Object, Y extends java.lang.Object> {
public abstract <Z extends java.lang.Object>void foo(X x, Y y, Z z);
public abstract int getX();
@kotlin.Metadata()
public static final class DefaultImpls {
public DefaultImpls() {
super();
}
public static <X extends java.lang.Object, Y extends java.lang.Object, Z extends java.lang.Object>void foo(@org.jetbrains.annotations.NotNull()
Foo<X, Y> $this, X x, Y y, Z z) {
}
public static <X extends java.lang.Object, Y extends java.lang.Object>int getX(@org.jetbrains.annotations.NotNull()
Foo<X, Y> $this) {
return 0;
}
}
}
@@ -127,6 +127,12 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi
runTest("plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.kt");
}
@Test
@TestMetadata("defaultImplsWithTypeParameters.kt")
public void testDefaultImplsWithTypeParameters() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.kt");
}
@Test
@TestMetadata("defaultPackage.kt")
public void testDefaultPackage() throws Exception {
@@ -127,6 +127,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla
runTest("plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.kt");
}
@Test
@TestMetadata("defaultImplsWithTypeParameters.kt")
public void testDefaultImplsWithTypeParameters() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.kt");
}
@Test
@TestMetadata("defaultPackage.kt")
public void testDefaultPackage() throws Exception {