JS: deparenthesize LHS of assignment before choosing appropriate AccessTranslator. Fix KT-15169

This commit is contained in:
Alexey Andreev
2016-12-12 15:00:00 +03:00
parent 52347aa901
commit d9cf15a665
10 changed files with 52 additions and 36 deletions
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
fun box(): String {
var x = 1
(foo@ x)++
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
var holder = ""
var globalA: A = A(-1)
get(): A {
@@ -0,0 +1,13 @@
@Target(AnnotationTarget.EXPRESSION)
annotation class Annotation
fun box(): String {
var v = 0
@Annotation v += 1 + 2
if (v != 3) return "fail1"
@Annotation v = 4
if (v != 4) return "fail2"
return "OK"
}
-3
View File
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
package name
class Test() {
@@ -0,0 +1,8 @@
public final class AnnotatedAssignmentKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}
@kotlin.annotation.Target
@java.lang.annotation.Retention
@java.lang.annotation.Target
public annotation class Annotation
@@ -10487,6 +10487,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/operatorConventions"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("annotatedAssignment.kt")
public void testAnnotatedAssignment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/annotatedAssignment.kt");
doTest(fileName);
}
@TestMetadata("assignmentOperations.kt")
public void testAssignmentOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/assignmentOperations.kt");
@@ -10487,6 +10487,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/operatorConventions"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("annotatedAssignment.kt")
public void testAnnotatedAssignment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/annotatedAssignment.kt");
doTest(fileName);
}
@TestMetadata("assignmentOperations.kt")
public void testAssignmentOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/assignmentOperations.kt");
@@ -10487,6 +10487,12 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/operatorConventions"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("annotatedAssignment.kt")
public void testAnnotatedAssignment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/annotatedAssignment.kt");
doTest(fileName);
}
@TestMetadata("assignmentOperations.kt")
public void testAssignmentOperations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/assignmentOperations.kt");