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

Top-level functions are not properly namespaced or genericized #516

Open
kengorab opened this issue Dec 8, 2024 · 0 comments
Open

Top-level functions are not properly namespaced or genericized #516

kengorab opened this issue Dec 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kengorab
Copy link
Owner

kengorab commented Dec 8, 2024

The most striking example of this is the Ok function, which is a convenience helper for Result.Ok. This is a top-level free function (ie. not a method), and it is compiled down to simply $.Ok. If there were another function in a different scope called Ok (irrelevant for this particular example of course, since Ok is a prelude function and is always defined and thus can never be overwritten, but the point still stands), or if there were multiple types invoked for that function (eg. Ok(1.23) and Ok(1) within the same program, the float one would likely be codegen-ed as an integer, which would break) this causes issues.

@kengorab kengorab added the bug Something isn't working label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant