Browse Source

Tests for #6135 and #6169 (#6228)

* Test for issue #6135

* Test for issue #6169
Mario Carbajal 8 years ago
parent
commit
b55cc0b713
2 changed files with 27 additions and 0 deletions
  1. 10 0
      tests/unit/src/unit/issues/Issue6135.hx
  2. 17 0
      tests/unit/src/unit/issues/Issue6169.hx

+ 10 - 0
tests/unit/src/unit/issues/Issue6135.hx

@@ -0,0 +1,10 @@
+package unit.issues;
+
+class Issue6135 extends unit.Test {
+	@:analyzer(ignore)
+	function test() {
+		var x:Array<Dynamic> = [1];
+		x[0] = "hi";
+		t(x[0] == "hi");
+	}
+}

+ 17 - 0
tests/unit/src/unit/issues/Issue6169.hx

@@ -0,0 +1,17 @@
+package unit.issues;
+
+class Rec {
+	var x : Int = 0;
+	public inline function new(rec:Bool) {
+		if ( rec ) {
+			var r = new Rec(false);
+			x = r.x;
+		}
+	}
+}
+
+class Issue6169 extends unit.Test {
+	function test() {
+		var r = new Rec(false);
+	}
+}