Skip to content
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

feat(ppx): disallow attribute payload in [@mel.new] #938

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

anmonteiro
Copy link
Member

this change unifies the FFI language a bit more, disallowing external declarations with [@@mel.new "Constructor"].

it plays better with the warnings that we issue when the external primitive name is "". In this case, the constructor must always appear in the primitive name, which makes the FFI language a bit more consistent.

@anmonteiro anmonteiro requested a review from jchavarri November 28, 2023 06:29
Copy link
Member

@jchavarri jchavarri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I wonder though if there is any case / weird combination of attributes that could allow to express something with the payload that is not possible to express with prim string? 🤔 Hopefully not.

@anmonteiro
Copy link
Member Author

I wonder though if there is any case / weird combination of attributes that could allow to express something with the payload that is not possible to express with prim string?

I don't think so. The only ones that come to mind are @mel.module and @mel.scope, which both carry payload.

@anmonteiro anmonteiro merged commit 09afa22 into main Nov 28, 2023
@anmonteiro anmonteiro deleted the anmonteiro/no-payload-in-new branch November 28, 2023 20:22
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.

2 participants