Browse Source

[python] keep Boot.add_dynamic for +=, fix #6551

frabbit 8 years ago
parent
commit
71eab1b649
2 changed files with 10 additions and 1 deletions
  1. 1 1
      src/optimization/dce.ml
  2. 9 0
      tests/unit/src/unit/issues/Issue6551.hx

+ 1 - 1
src/optimization/dce.ml

@@ -532,7 +532,7 @@ and expr dce e =
 		check_and_add_feature dce "array_write";
 		check_and_add_feature dce "array_read";
 		expr dce e1;
-	| TBinop(OpAdd,e1,e2) when is_dynamic e1.etype || is_dynamic e2.etype ->
+	| TBinop((OpAdd | OpAssignOp(OpAdd)),e1,e2) when is_dynamic e1.etype || is_dynamic e2.etype ->
 		check_and_add_feature dce "add_dynamic";
 		expr dce e1;
 		expr dce e2;

+ 9 - 0
tests/unit/src/unit/issues/Issue6551.hx

@@ -0,0 +1,9 @@
+package unit.issues;
+
+class Issue6551 extends unit.Test {
+    function test () {
+        var v:Dynamic = "foo";
+        v += v;
+		eq(v, "foofoo");
+    }
+}