Simon Krajewski 12 роки тому
батько
коміт
171cc4f2c5
2 змінених файлів з 6 додано та 0 видалено
  1. 5 0
      interp.ml
  2. 1 0
      std/haxe/macro/Expr.hx

+ 5 - 0
interp.ml

@@ -4284,6 +4284,11 @@ let decode_type_def v =
 		EClass (mk flags fields)
 	| 3, [t] ->
 		ETypedef (mk (if isExtern then [EExtern] else []) (decode_ctype t))
+	| 4, [tthis;tfrom;tto] ->
+		let flags = match opt decode_ctype tfrom with None -> [] | Some t -> [AFromType t] in
+		let flags = match opt decode_ctype tto with None -> flags | Some t -> (AToType t) :: flags in
+		let flags = (AIsType (decode_ctype tthis)) :: flags in
+		EAbstract(mk flags fields)
 	| _ ->
 		raise Invalid_expr
 	) in

+ 1 - 0
std/haxe/macro/Expr.hx

@@ -223,6 +223,7 @@ enum TypeDefKind {
 	TDStructure;
 	TDClass( ?superClass : TypePath, ?interfaces : Array<TypePath>, ?isInterface : Bool );
 	TDAlias( t : ComplexType ); // ignore TypeDefinition.fields
+	TDAbstract( tthis : ComplexType, ?from : ComplexType, ?to: ComplexType );
 }
 
 /**