Sfoglia il codice sorgente

[parser] fix type path magic properly

Simon Krajewski 7 anni fa
parent
commit
3e7f36879a
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      src/syntax/grammar.mly
  2. 1 1
      src/typing/typeload.ml

+ 1 - 1
src/syntax/grammar.mly

@@ -501,7 +501,7 @@ and parse_structural_extension = parser
 					| [< '(Comma,_) >] -> ()
 					| [< >] -> ()
 				end;
-				{ tpackage = []; tname = ""; tparams = []; tsub = None },null_pos
+				magic_type_path,null_pos
 			end else raise Stream.Failure
 
 and parse_complex_type_inner allow_named = parser

+ 1 - 1
src/typing/typeload.ml

@@ -105,7 +105,7 @@ with Error((Module_not_found _ | Type_not_found _),p2) when p = p2 ->
 *)
 let load_type_def ctx p t =
 	let no_pack = t.tpackage = [] in
-	if t == Parser.magic_type_path then raise_fields (DisplayToplevel.collect ctx None NoValue) CRTypeHint None;
+	if t = Parser.magic_type_path then raise_fields (DisplayToplevel.collect ctx None NoValue) CRTypeHint None;
 	(* The type name is the module name or the module sub-type name *)
 	let tname = (match t.tsub with None -> t.tname | Some n -> n) in
 	try