Browse Source

fix metadata completion showing up in trace arguments (closes #5775)

Simon Krajewski 8 years ago
parent
commit
a9f40fe610
3 changed files with 17 additions and 1 deletions
  1. 1 0
      extra/CHANGES.txt
  2. 1 1
      src/typing/typer.ml
  3. 15 0
      tests/display/src/cases/Issue5775.hx

+ 1 - 0
extra/CHANGES.txt

@@ -9,6 +9,7 @@
 	all : fixed top-down inference infinite recursion issue (#5848)
 	all : fixed top-down inference infinite recursion issue (#5848)
 	all : fixed regression in Compiler.include (#5847)
 	all : fixed regression in Compiler.include (#5847)
 	all : fixed Not_found exception related to try/catch (#5851)
 	all : fixed Not_found exception related to try/catch (#5851)
+	all : fixed metadata completion showing up in trace arguments (#5775)
 	cpp : fixed issue with cpp.Pointer variables being eliminated (#5850)
 	cpp : fixed issue with cpp.Pointer variables being eliminated (#5850)
 	js : added Notification API to HTML externs (#5852)
 	js : added Notification API to HTML externs (#5852)
 	js : fixed several options structures in HTML externs (#5849)
 	js : fixed several options structures in HTML externs (#5849)

+ 1 - 1
src/typing/typer.ml

@@ -4064,7 +4064,7 @@ and type_call ctx e el (with_type:with_type) p =
 		if Common.defined ctx.com Define.NoTraces then
 		if Common.defined ctx.com Define.NoTraces then
 			null ctx.t.tvoid p
 			null ctx.t.tvoid p
 		else
 		else
-		let mk_to_string_meta e = EMeta((Meta.ToString,[],pos e),e),pos e in
+		let mk_to_string_meta e = EMeta((Meta.ToString,[],null_pos),e),pos e in
 		let params = (match el with [] -> [] | _ -> [("customParams",null_pos),(EArrayDecl (List.map mk_to_string_meta el) , p)]) in
 		let params = (match el with [] -> [] | _ -> [("customParams",null_pos),(EArrayDecl (List.map mk_to_string_meta el) , p)]) in
 		let infos = mk_infos ctx p params in
 		let infos = mk_infos ctx p params in
 		if (platform ctx.com Js || platform ctx.com Python) && el = [] && has_dce ctx.com then
 		if (platform ctx.com Js || platform ctx.com Python) && el = [] && has_dce ctx.com then

+ 15 - 0
tests/display/src/cases/Issue5775.hx

@@ -0,0 +1,15 @@
+package cases;
+
+class Issue5775 extends DisplayTestCase {
+	/**
+	class Main {
+		static function main () {
+			var a = [];
+			trace('${a.{-1-}}');
+		}
+	}
+	**/
+	function testType1() {
+		eq(true, hasField(fields(pos(1)), "length", "Int"));
+	}
+}