Sfoglia il codice sorgente

[analyzer] test for unreachable loop exit
closes #8912

Aleksandr Kuzmenko 5 anni fa
parent
commit
c35ed59fd2
1 ha cambiato i file con 21 aggiunte e 0 eliminazioni
  1. 21 0
      tests/unit/src/unit/issues/Issue8912.hx

+ 21 - 0
tests/unit/src/unit/issues/Issue8912.hx

@@ -0,0 +1,21 @@
+package unit.issues;
+
+class Issue8912 extends Test {
+	function test() {
+		function loop() {
+			while(true) {
+				exit();
+				continue;
+			}
+		}
+		try {
+			loop();
+		} catch(e:String) {
+			noAssert();
+		}
+	}
+
+	static function exit() {
+		throw 'exit';
+	}
+}