瀏覽代碼

add test (closes #6267)

this is somewhat fragile...
Dan Korostelev 8 年之前
父節點
當前提交
21f7f617f4
共有 1 個文件被更改,包括 23 次插入0 次删除
  1. 23 0
      tests/unit/src/unit/issues/Issue6267.hx

+ 23 - 0
tests/unit/src/unit/issues/Issue6267.hx

@@ -0,0 +1,23 @@
+package unit.issues;
+
+class Issue6267 extends unit.Test {
+
+	function test() {
+		eq(doTest(0), 1);
+	}
+
+	static function doTest(v:Int) {
+		while (true) {
+			switch (v) {
+				case 0: return call({f: impure()});
+				case 1: break;
+				case _: break;
+			}
+		}
+		return 42;
+	}
+
+	static function call(o:{f:Int}) return o.f;
+
+	@:pure(false) static function impure() return 1;
+}