Bläddra i källkod

[as3] create TCast to String using `as` (closes #3719)

Simon Krajewski 10 år sedan
förälder
incheckning
34737be814
2 ändrade filer med 9 tillägg och 1 borttagningar
  1. 1 1
      genas3.ml
  2. 8 0
      tests/unit/src/unit/issues/Issue3719.hx

+ 1 - 1
genas3.ml

@@ -881,7 +881,7 @@ and gen_value ctx e =
 		begin match s with
 		| "*" ->
 			gen_value ctx e1
-		| "Function" | "Array" ->
+		| "Function" | "Array" | "String" ->
 			spr ctx "((";
 			gen_value ctx e1;
 			print ctx ") as %s)" s;

+ 8 - 0
tests/unit/src/unit/issues/Issue3719.hx

@@ -0,0 +1,8 @@
+package unit.issues;
+
+class Issue3719 extends Test {
+	function test() {
+		var s:String = cast null;
+		f("null" == s);
+	}
+}