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
Warning for different module components with the same name #7430
Comments
Comment author: @lpw25 This is intended behavior. Those things live in different namespaces. |
Comment author: @lpw25 |
Comment author: @bobzhang is this not discussible? I am not saying this is a bug.. |
Comment author: @lpw25 Well it would be a hugely backwards incompatible change, and the only benefit put forward is that it would make your code-gen easier to write, so it doesn't seem like it is a particularly viable change. |
Comment author: @bobzhang We can fix it on our side(either simply reject such programs or do the name mangling). But I am very surprised to read such programs:
I think spit out a warning is reasonable feature request |
Comment author: @lpw25
I agree. I'll edit the description and mark this issue unresolved. |
Comment author: @lpw25 (Although I'm not personally in favour of the warning) |
Comment author: @alainfrisch It's rather common to have values and types with the same name. Hongbo: Would you include this case in the warning? I understand that this case does not impact Bucklescript (no runtime value corresponding to types), but it would be rather incoherent to warn in other cases but not this one. |
Comment author: @alainfrisch
You could also group extensible constructors and classes in sub-objects of the generated Javascript module (they are much less likely to be required by JS code than regular values and modules). |
Comment author: @bobzhang currently we take the easy route: spit out a compiler error when detecting two runtime components exported with the same name having the same name(this happens very rare in practice and probably should not pass review). |
Comment author: @bobzhang if we have a warning, it could provide better error message(we can turn it into an error on our side) |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
I don't think there is an interest towards this outside of the bucklescript compiler team. I suggest that we close this ticket for now, and you can make a PR implementing a (disabled by default) warning when you feel ready. |
Thanks for the ping. Feel free to close it, but I think it is a nice thing
to have
…On Sat, May 9, 2020 at 11:59 PM Gabriel Radanne ***@***.***> wrote:
I don't think there is an interest towards this outside of the
bucklescript compiler team. I suggest that we close this ticket for now,
and you can make a PR implementing a (disabled by default) warning when you
feel ready.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7430 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFWMK6L3D7NXBLKLZZB5E3RQV4WDANCNFSM4M4UFJFA>
.
--
Regards
-- Hongbo Zhang
|
Original bug ID: 7430
Reporter: @bobzhang
Status: acknowledged (set by @mshinwell on 2016-12-12T16:00:03Z)
Resolution: open
Priority: normal
Severity: feature
Category: typing
Bug description
Just realized today that the code below is possible in OCaml:
This is very confusing. A warning for such definitions could be useful.
The text was updated successfully, but these errors were encountered: