Преглед изворни кода

[display] deal with EObjectDecl toplevel special case

see #8651
Simon Krajewski пре 6 година
родитељ
комит
1a4c4b34de
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      src/typing/typerDisplay.ml

+ 3 - 0
src/typing/typerDisplay.ml

@@ -399,6 +399,9 @@ and display_expr ctx e_ast e dk with_type p =
 		begin match fst e_ast,e.eexpr with
 			| EField(e1,s),TField(e2,_) ->
 				display_fields e1 e2 (String.length s)
+			(* | EObjectDecl [(name,pn,_),(EConst (Ident "null"),pe)],_ when pe.pmin = -1 ->
+				(* This is what the parser emits for #8651. Bit of a dodgy heuristic but should be fine. *)
+				raise_toplevel ctx dk with_type (name,pn) None *)
 			| _ ->
 				if dk = DKDot then display_fields e_ast e 0
 				else begin