Browse Source

expose TVar.meta (it was already encoded, but in a wrong way, and wasn't presented in the haxe type)

Dan Korostelev 9 năm trước cách đây
mục cha
commit
e43164082d
2 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 1 1
      src/macro/interp.ml
  2. 5 0
      std/haxe/macro/Type.hx

+ 1 - 1
src/macro/interp.ml

@@ -4748,7 +4748,7 @@ and encode_tvar v =
 		"t", encode_type v.v_type;
 		"capture", VBool v.v_capture;
 		"extra", vopt f_extra v.v_extra;
-		"meta", encode_meta_content v.v_meta;
+		"meta", encode_meta v.v_meta (fun m -> v.v_meta <- m);
 		"$", VAbstract (AUnsafe (Obj.repr v));
 	]
 

+ 5 - 0
std/haxe/macro/Type.hx

@@ -728,6 +728,11 @@ typedef TVar = {
 		information
 	**/
 	public var extra(default,never):Null<{params: Array<TypeParameter>, expr: Null<TypedExpr>}>;
+
+	/**
+		The metadata of the variable.
+	**/
+	public var meta(default,never):Null<MetaAccess>;
 }
 
 /**