Codegen should just skip (local) type alias declarations.
This commit is contained in:
@@ -360,6 +360,11 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
return visitClassOrObject(klass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StackValue visitTypeAlias(@NotNull KtTypeAlias typeAlias, StackValue data) {
|
||||
return StackValue.none();
|
||||
}
|
||||
|
||||
private StackValue visitClassOrObject(KtClassOrObject declaration) {
|
||||
ClassDescriptor descriptor = bindingContext.get(CLASS, declaration);
|
||||
assert descriptor != null;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
class Cell<TC>(val x: TC)
|
||||
|
||||
object OkHost {
|
||||
val value = "OK"
|
||||
}
|
||||
|
||||
fun <T> id(x: T): T {
|
||||
typealias C = Cell<T>
|
||||
val c: C = C(x)
|
||||
return c.x
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
typealias OK = OkHost
|
||||
return id(OK.value)
|
||||
}
|
||||
@@ -14581,6 +14581,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/typealias"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("localTypeAlias.kt")
|
||||
public void testLocalTypeAlias() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/localTypeAlias.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/typealias/simple.kt");
|
||||
|
||||
Reference in New Issue
Block a user