Relax uninterpretable attributes (such as non-BuckleScript @@deriving payloads) from error to warn #4911
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the moment,
@@bs.deriving
(and other BuckleScript-interpreted attributes) cause a fatal error if they encounter payloads they don't understand in the AST. This is problematic as of #4701, now that BuckleScript's@@deriving
and OCaml-native@@deriving
(fromppx_deriving
) attempt to interpret the same key:For compatibility's sake, I've reduced this error to a compile-time warning (w+104, the same quieting-category as used in the other 'idk wtf to do with this' deriving-case).
After these changes, the above snippet will yield this warning:
Ideally, I'd like to see this more fully understand OCaml-native
ppx_deriving
payloads - not to interpret them, but to provide better error-messages (i.e. differentiate between "uninterpretedppx_deriving
payload" and "genuinely typo'd-or-incorrect payload"), but for now, at least this fix unblocks existing hybrid BS/native projects, and will allow me to fix thebs-deriving
compatibility project!