Bläddra i källkod

fix retarded matching display bug

Simon Krajewski 9 år sedan
förälder
incheckning
41c7be8146
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      src/typing/matcher.ml

+ 2 - 2
src/typing/matcher.ml

@@ -1242,7 +1242,7 @@ module TexprConverter = struct
 		let p = dt.dt_pos in
 		let p = dt.dt_pos in
 		let c_type = match follow (Typeload.load_instance ctx ({ tpackage = ["std"]; tname="Type"; tparams=[]; tsub = None},null_pos) true p) with TInst(c,_) -> c | t -> assert false in
 		let c_type = match follow (Typeload.load_instance ctx ({ tpackage = ["std"]; tname="Type"; tparams=[]; tsub = None},null_pos) true p) with TInst(c,_) -> c | t -> assert false in
 		let mk_index_call e =
 		let mk_index_call e =
-			if not ctx.com.display.DisplayMode.dms_full_typing then
+			if not ctx.in_macro && not ctx.com.display.DisplayMode.dms_full_typing then
 				(* If we are in display mode there's a chance that these fields don't exist. Let's just use a
 				(* If we are in display mode there's a chance that these fields don't exist. Let's just use a
 				   (correctly typed) neutral value because it doesn't actually matter. *)
 				   (correctly typed) neutral value because it doesn't actually matter. *)
 				mk (TConst (TInt (Int32.of_int 0))) ctx.t.tint e.epos
 				mk (TConst (TInt (Int32.of_int 0))) ctx.t.tint e.epos
@@ -1251,7 +1251,7 @@ module TexprConverter = struct
 				make_static_call ctx c_type cf (fun t -> t) [e] com.basic.tint e.epos
 				make_static_call ctx c_type cf (fun t -> t) [e] com.basic.tint e.epos
 		in
 		in
 		let mk_name_call e =
 		let mk_name_call e =
-			if not ctx.com.display.DisplayMode.dms_full_typing then
+			if not ctx.in_macro && not ctx.com.display.DisplayMode.dms_full_typing then
 				mk (TConst (TString "")) ctx.t.tstring e.epos
 				mk (TConst (TString "")) ctx.t.tstring e.epos
 			else
 			else
 				let cf = PMap.find "enumConstructor" c_type.cl_statics in
 				let cf = PMap.find "enumConstructor" c_type.cl_statics in