Skip to content

Conversation

@Skepfyr
Copy link
Contributor

@Skepfyr Skepfyr commented Dec 10, 2025

This means ppxlib doesn't emit a warning for code like [@attr [%ext]]. Previously, it would warn that [%ext] wasn't translated, however this is essentially always not the desired behaviour; the ppx that interprets the attribute will be called before the one that interprets the extension (assuming context free ppxes) so the attribute handling will have to handle the extension itself. If the attribute substitues the extension into generated code the warning will still trigger if that substituted extension point isn't expanded.

I'm slightly nervous this will cause weird errors if you put extensions inside the payload of builtin attributes, however I don't think there are any that can have an extension in their payload so it's probably fine.

This means ppxlib doesn't emit a warning for code like `[@attr [%ext]]`.
Previously, it would warn that `[%ext]` wasn't translated, however this
is essentially always not the desired behaviour; the ppx that interprets
the attribute will be called before the one that interprets the
extension (assuming context free ppxes) so the attribute handling will
have to handle the extension itself. If the attribute substitues the
extension into generated code the warning will still trigger if that
substituted extension point isn't expanded.

I'm slightly nervous this will cause weird errors if you put extensions
inside the payload of builtin attributes, however I don't think there
are any that can have an extension in their payload so it's probably fine.

Signed-off-by: Jack Rickard <[email protected]>
@Skepfyr Skepfyr force-pushed the jrickard/ignore-extensions-in-attributes branch from 6942f77 to 37c0ed9 Compare December 10, 2025 12:20
Signed-off-by: Jack Rickard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant