Quellcode durchsuchen

allow using `@:op(a.b)` instead of `@:resolve` (see #4275)

Simon Krajewski vor 10 Jahren
Ursprung
Commit
075298f982
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      tests/unit/src/unit/issues/Issue3753.hx
  2. 1 1
      typeload.ml

+ 1 - 1
tests/unit/src/unit/issues/Issue3753.hx

@@ -29,7 +29,7 @@ private abstract C(Map<String, String>) from Map<String, String> {
 }
 
 private abstract D(Map<String, String>) from Map<String, String> {
-	@:resolve
+	@:op(a.b)
 	macro static function resolve(ethis:haxe.macro.Expr, name:String) {
 		var s = switch (name) {
 			case "foo": "bar";

+ 1 - 1
typeload.ml

@@ -2375,7 +2375,7 @@ let init_class ctx c p context_init herits fields =
 									display_error ctx ("First argument of implementation function must be " ^ (s_type (print_context()) tthis)) f.cff_pos
 							end;
 							loop ml
-						| (Meta.Resolve,_,_) :: _ ->
+						| ((Meta.Resolve,_,_) | (Meta.Op,[EField _,_],_)) :: _ ->
 							if a.a_resolve <> None then error "Multiple resolve methods are not supported" cf.cf_pos;
 							let targ = if Meta.has Meta.Impl f.cff_meta then tthis else ta in
 							begin match follow t with