Browse Source

one more tricky test to fix

Nicolas Cannasse 13 years ago
parent
commit
cfdd016958
1 changed files with 15 additions and 0 deletions
  1. 15 0
      tests/unit/TestMisc.hx

+ 15 - 0
tests/unit/TestMisc.hx

@@ -184,6 +184,21 @@ class TestMisc extends Test {
 		eq( std.haxe.Md5.encode(""), "d41d8cd98f00b204e9800998ecf8427e");
 		eq( std.Std.int(45.3), 45);
 	}
+	
+	function testHiddenTypeCapture() {
+		var flag = true;
+		var foo = null, bar = null;
+		if( flag ) {
+			var haxe = 20;
+			var Std = 50;
+			foo = function() return haxe;
+			bar = function() return Std;
+		}
+		eq( std.haxe.Md5.encode(""), "d41d8cd98f00b204e9800998ecf8427e");
+		eq( std.Std.int(45.3), 45);
+		eq( foo(), 20);
+		eq( bar(), 50);
+	}
 
 	function id(x) {
 		return x;