Browse Source

fix lazy display (closes #5128)

Simon Krajewski 9 years ago
parent
commit
b55a3422fd

+ 1 - 2
src/typing/typeload.ml

@@ -2122,8 +2122,7 @@ module ClassInitializer = struct
 			| TAbstract _ | TInst _ | TEnum _ | TLazy _ | TDynamic _ | TAnon _ | TType _ -> true
 			| TAbstract _ | TInst _ | TEnum _ | TLazy _ | TDynamic _ | TAnon _ | TType _ -> true
 		in
 		in
 		if ctx.com.display <> DMNone then begin
 		if ctx.com.display <> DMNone then begin
-			let cp = !Parser.resume_display in
-			if cctx.is_display_file && (cp.pmin = 0 || (p.pmin <= cp.pmin && p.pmax >= cp.pmax)) then begin
+			if fctx.is_display_field then begin
 				if fctx.is_macro && not ctx.in_macro then
 				if fctx.is_macro && not ctx.in_macro then
 					(* force macro system loading of this class in order to get completion *)
 					(* force macro system loading of this class in order to get completion *)
 					delay ctx PTypeField (fun() -> ignore(ctx.g.do_macro ctx MExpr c.cl_path cf.cf_name [] p))
 					delay ctx PTypeField (fun() -> ignore(ctx.g.do_macro ctx MExpr c.cl_path cf.cf_name [] p))

+ 3 - 0
tests/misc/projects/Issue5128/Main.hx

@@ -0,0 +1,3 @@
+class Main {
+	static function main():Void {}
+}

+ 1 - 0
tests/misc/projects/Issue5128/compile.hxml

@@ -0,0 +1 @@
+--display Main.hx@30@type

+ 3 - 0
tests/misc/projects/Issue5128/compile.hxml.stderr

@@ -0,0 +1,3 @@
+<type>
+Void -&gt; Void
+</type>