Test: inline class secondary constructors are called by inline class
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
// FILE: Z.kt
|
||||
inline class Z(val x: Int) {
|
||||
constructor(x: Long) : this(x.toInt())
|
||||
constructor(s: String) : this(s.length)
|
||||
constructor(a: Int, b: Int) : this(a + b)
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
fun test1() = Z(0L)
|
||||
fun test2() = Z("abcdef")
|
||||
fun test3() = Z(1, 2)
|
||||
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.constructor
|
||||
// 0 INVOKESTATIC Z\-Erased\.constructor
|
||||
// 1 INVOKESTATIC Z\.constructor \(J\)I
|
||||
// 1 INVOKESTATIC Z\.constructor \(Ljava/lang/String;\)I
|
||||
// 1 INVOKESTATIC Z\.constructor \(II\)I
|
||||
@@ -2068,6 +2068,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/functionsWithInlineClassParametersHaveStableMangledNames.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("factoryMethodForSecondaryConstructorsCalledByInlineClass.kt")
|
||||
public void testFactoryMethodForSecondaryConstructorsCalledByInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/factoryMethodForSecondaryConstructorsCalledByInlineClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("generationOfAccessorToUnderlyingValue.kt")
|
||||
public void testGenerationOfAccessorToUnderlyingValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/generationOfAccessorToUnderlyingValue.kt");
|
||||
|
||||
Reference in New Issue
Block a user