Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(Flash8) fix TEnumParameter (closes #2728)

  • Loading branch information...
commit 9383e61d2e79db380e209831d697f802a3955152 1 parent 573e862
@Simn Simn authored
Showing with 22 additions and 1 deletion.
  1. +1 −1  genswf8.ml
  2. +21 −0 tests/unit/issues/Issue2728.hx
View
2  genswf8.ml
@@ -590,7 +590,7 @@ let rec gen_access ?(read_write=false) ctx forcall e =
VarClosure
| TEnumParameter(e,_,i) ->
gen_expr ctx true e;
- push ctx [VInt i];
+ push ctx [VInt (i + 2)];
VarObj
| TField (e2,f) ->
gen_expr ctx true e2;
View
21 tests/unit/issues/Issue2728.hx
@@ -0,0 +1,21 @@
+package unit.issues;
+import unit.Test;
+
+private enum E {
+ A(d:Dynamic);
+ B;
+}
+
+class Issue2728 extends Test {
+ function test() {
+ var o = { foo: 12 };
+ var a = A(o);
+ var v = null;
+ switch(a) {
+ case A(d):
+ v = d;
+ case B:
+ }
+ eq(o, v);
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.