JS: fix identifier generation in delegate constructor calls

See KT-21093
This commit is contained in:
Alexey Andreev
2017-11-08 17:44:10 +03:00
parent fdeb916111
commit 21de76f88d
6 changed files with 56 additions and 2 deletions
@@ -3581,6 +3581,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
doTest(fileName);
}
@TestMetadata("delegateConstructorCallWithKeywords.kt")
public void testDelegateConstructorCallWithKeywords() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/delegateConstructorCallWithKeywords.kt");
doTest(fileName);
}
@TestMetadata("delegation2.kt")
public void testDelegation2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/delegation2.kt");
@@ -253,8 +253,8 @@ class ClassTranslator private constructor(
context.addDeclarationStatement(constructorInitializer.makeStmt())
context = context.contextWithScope(constructorInitializer)
context.translateAndAliasParameters(constructorDescriptor, constructorInitializer.parameters)
.translateFunction(constructor, constructorInitializer)
.translateAndAliasParameters(constructorDescriptor, constructorInitializer.parameters)
context.translateFunction(constructor, constructorInitializer)
// Translate super/this call
val superCallGenerators = mutableListOf<(MutableList<JsStatement>) -> Unit>()