You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let()=letmake_rulename=Context_free.Rule.attr_str_type_decl_expect
(Attribute.declare
name
Type_declarationAst_pattern.(pstr nil)
(funx -> x))
(fun~ctxt:____ ->
let loc =Location.none in
[ Ast_builder.Default.(pstr_eval ~loc (estring ~loc ("I am "^ name)) []) ])
inDriver.register_transformation
"foobar"~rules:[ make_rule "bar.foo"; make_rule "qux.foo" ];
Would allow:
typet = int [@@bar.foo]
"I am bar.foo"
[@@@end]
typeu = int [@@qux.foo]
"I am qux.foo"
[@@@end]
typev = int [@@foo]
"I am bar.foo";;
"I am qux.foo"
[@@@end]
It seems that ppxlib doesn't protect against an attribute from being matched by two (or more) different Attribute.t declarations in instances when the name is ambiguous. The same issue exists for Attribute.Floating.ts.
The text was updated successfully, but these errors were encountered:
The concrete issue here would be that some ppxes may decide to use their own [@@@myppx.end] attribute. In such cases, [@@@end] would get interpreted for both myppx and as deriving.end.
Users can always temporarily work around this by forcing their [@@@myppx.end] to be fully qualified, but thought I'd just file an issue to document this bug, if ever it becomes more relevant to fix in the future.
I don't think this is blocking for releasing #560.
The following:
Would allow:
It seems that
ppxlib
doesn't protect against anattribute
from being matched by two (or more) differentAttribute.t
declarations in instances when the name is ambiguous. The same issue exists forAttribute.Floating.t
s.The text was updated successfully, but these errors were encountered: