-
Notifications
You must be signed in to change notification settings - Fork 315
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
Implement glob import semantics for builtin type names #682
Comments
Design sketch: Constraints:
Design proposal:
Does that sound about right @dtolnay? |
If you aren't going to get to it soon @adetaylor, I could potentially take a good stab at implementing the above design this coming week. |
That would be great, yes. I don't think I'm realistically going to get to it in the next few days. If I start, I'll post here - but it's extremely unlikely :) (Either way we should wait for @dtolnay to tell me that my design sketch is nonsense) |
(Had some free time, decided to take a look at this again.)
This can't work as-written, as
The other approach I can think of is to not do an inplace fixup of |
#908 attempts to implement this via keeping a new mapping of types to atoms, which is used by downstream passes instead of |
Currently we disallow any user-defined type name that collides with one of the builtin type names.
However, this is bad because it makes it a breaking change for us to add new builtin bindings, such as #681. If the user already had their own type with the same name as the new binding, that code needs to continue to work.
We need to implement basically the same semantics that Rust has for prelude types and glob imports — a user-defined type replaces any builtin binding of the same name.
The text was updated successfully, but these errors were encountered: