瀏覽代碼

maybe fix and change test

really not sure about whether this should be allowed...
Dan Korostelev 4 年之前
父節點
當前提交
80aec73c5e

+ 2 - 1
src/optimization/analyzerTexprTransformer.ml

@@ -256,7 +256,8 @@ let rec func ctx bb tf t p =
 						if bb == g.g_unreachable then raise Exit;
 						loop2 bb el
 					| [] ->
-						die "" __LOC__
+						(* TODO: is this correct? *)
+						bb,ctx.com.basic.evoid e.epos
 				in
 				let bb,e = loop2 bb el in
 				loop bb e

+ 1 - 1
tests/misc/projects/Issue8972/Main.hx

@@ -1,5 +1,5 @@
 class Main {
 	static function main() {
-		trace([if(false) 1]);
+		$type([if(false) 1]);
 	}
 }

+ 0 - 1
tests/misc/projects/Issue8972/compile-fail.hxml.stderr

@@ -1 +0,0 @@
-Main.hx:3: characters 10-21 : Cannot use Void as value

+ 0 - 0
tests/misc/projects/Issue8972/compile-fail.hxml → tests/misc/projects/Issue8972/compile.hxml


+ 1 - 0
tests/misc/projects/Issue8972/compile.hxml.stderr

@@ -0,0 +1 @@
+Main.hx:3: characters 9-22 : Warning : Array<Void>