-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
PPX: reconsider disabling warning 20 in all functions #1165
Comments
Another alternative to reconsider to force users to add the types of these unsafe JS snippets is to define them as externals, e.g.: external addOne: int -> int = {raw_js|
function (a) {
return a + 1;
}
|raw_js}
let x = addOne 2 |
melange uses flowparser to know the arity of the function, why do we make the user annotate the function in the first place? |
Because arity only is not enough to get the type of the function. And in JavaScript it's even worse, e.g. consider |
Oh, I guess you meant why the compiler can't give |
In #915, the silencing of warning 20 was moved to all function applications (regardless if the function is defined with
mel.raw
or not).I understand it's impossible to detect this kind of situation at PPX time. But I wonder if the silencing should be removed from the PPX, and instead document in
mel.raw
docs that these functions need to be explicitly annotated? E.g. if the ppx was modified to not add the attribute, this test would trigger the following results:The text was updated successfully, but these errors were encountered: