-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addGlobalMetadata applied twice on abstracts #11545
Comments
Right, with recursive it's added to both abstract and impl, and since now we're forwarding those to impl from abstract, it ends up there twice.. |
I think we should not check global metadata for abstract implementation classes. |
That's an option, though I'm not exactly sure if it can lead to problems 🤔 Another option: diff --git a/src/typing/typeloadModule.ml b/src/typing/typeloadModule.ml
index 701dd8913..2c9a88706 100644
--- a/src/typing/typeloadModule.ml
+++ b/src/typing/typeloadModule.ml
@@ -571,7 +571,7 @@ module TypeLevel = struct
Option.may (fun c ->
List.iter (fun m -> match m with
| ((Meta.Using | Meta.Build | Meta.CoreApi | Meta.Allow | Meta.Access | Meta.Enum | Meta.Dce | Meta.Native | Meta.HlNative | Meta.JsRequire | Meta.PythonImport | Meta.Expose | Meta.Deprecated | Meta.PhpGlobal | Meta.PublicFields),_,_) ->
- c.cl_meta <- m :: c.cl_meta;
+ if not (List.mem m c.cl_meta) then c.cl_meta <- m :: c.cl_meta;
| _ ->
()
) a.a_meta; This works here (for deduplication) because it's the exact same meta. |
without recursive how would I check to avoid applying my modifications twice in case of abstracts? |
I still think that if Also please don't |
Checking what CI thinks about it |
* [typer] don't add meta to abstract impl through addGlobalMetadata * [tests] add test for #11545
I've noticed that metadata added via
addGlobalMetadata
appears twice on abstracts with recent nightliessteps to reproduce:
src/demo/Main.hx
src/demo/Macro.hx
compiling with:
results in
dump/eval/demo/_Main/ImageName_Impl_.dump
having two@:build…
metadata and it has two traces added to it's constructor / all functions.The text was updated successfully, but these errors were encountered: