KT-13836: fix generation of FQN of secondary constructor when it's called via typealias. Fix #KT-13836

This commit is contained in:
Alexey Andreev
2016-09-14 12:11:22 +03:00
parent 115d63a2f3
commit 5d34f5fb75
5 changed files with 60 additions and 0 deletions
@@ -0,0 +1,9 @@
object O {
val x = "OK"
operator fun invoke() = x
}
typealias A = O
fun box(): String = A()
@@ -0,0 +1,11 @@
class C(val x: String) {
constructor(n: Int) : this(n.toString())
}
typealias Alias = C
fun box(): String {
val c = Alias(23)
if (c.x != "23") return "fail: $c"
return "OK"
}
@@ -15603,6 +15603,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/typeAliasObject.kt");
doTest(fileName);
}
@TestMetadata("typeAliasObjectCallable.kt")
public void testTypeAliasObjectCallable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/typeAliasObjectCallable.kt");
doTest(fileName);
}
@TestMetadata("typeAliasSecondaryConstructor.kt")
public void testTypeAliasSecondaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/typeAliasSecondaryConstructor.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/unaryOp")