IR: create stubs for constructor type parameters

Java constructors can have type parameters of their own:
  public class J<X extends Number> {
    public <Y extends CharSequence> J() {}
  }

When such constructors are called from Kotlin, type parameters for
constructor follow type parameters for class:
  fun test() = J<Int, String>() // <X=Int, Y=String>

Descriptor-based representation uses the same type parameters ordering.

Also, use 'withScope' in IrLazyFunction type parameters creation.
This commit is contained in:
Dmitry Petrov
2019-03-25 17:45:31 +03:00
parent 8be7f7f1f7
commit 2c9ed73ba8
6 changed files with 58 additions and 11 deletions
@@ -1518,6 +1518,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt");
}
@TestMetadata("javaConstructorWithTypeParameters.kt")
public void testJavaConstructorWithTypeParameters() throws Exception {
runTest("compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.kt");
}
@TestMetadata("javaEnum.kt")
public void testJavaEnum() throws Exception {
runTest("compiler/testData/ir/irText/stubs/javaEnum.kt");