2
0
Эх сурвалжийг харах

cl_shadow flag for extends/type params

Nicolas Cannasse 18 жил өмнө
parent
commit
d339b689d5
2 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 2 0
      type.ml
  2. 3 1
      typer.ml

+ 2 - 0
type.ml

@@ -115,6 +115,7 @@ and tclass = {
 	cl_doc : Ast.documentation;
 	cl_private : bool;
 	mutable cl_extern : bool;
+	mutable cl_shadow : bool;
 	mutable cl_interface : bool;
 	mutable cl_types : (string * t) list;
 	mutable cl_super : (tclass * tparams) option;
@@ -196,6 +197,7 @@ let mk_class path pos doc priv =
 		cl_doc = doc;
 		cl_private = priv;
 		cl_extern = false;
+		cl_shadow = false;
 		cl_interface = false;
 		cl_types = [];
 		cl_super = None;

+ 3 - 1
typer.ml

@@ -361,7 +361,8 @@ and load_type ctx p t =
 						with
 							Not_found -> ()
 					) a.a_fields;
-					c2.cl_extern <- true;
+					(* do NOT tag as extern - for protect *)
+					c2.cl_shadow <- true;
 					c2.cl_super <- Some (c,tl);
 					c2.cl_fields <- a.a_fields;
 					TInst (c2,[])
@@ -658,6 +659,7 @@ let type_type_params ctx path p (n,flags) =
 			t
 		) in
 		c.cl_extern <- true;
+		c.cl_shadow <- true;
 		ctx.delays := [(fun () -> ignore(!r()))] :: !(ctx.delays);
 		TLazy r
 	) in