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

[Feature Request] Autopromotion of literal types to concrete types #100

Closed
2 tasks
Mogball opened this issue May 11, 2023 · 2 comments
Closed
2 tasks

[Feature Request] Autopromotion of literal types to concrete types #100

Mogball opened this issue May 11, 2023 · 2 comments
Labels
enhancement New feature or request mojo Issues that are related to mojo mojo-lang Tag for all issues related to language. mojo-repo Tag all issues with this label mojo-stdlib Tag for issues related to standard library

Comments

@Mogball
Copy link
Collaborator

Mogball commented May 11, 2023

There are a large handful of issues that fall into the same category, so I am combining them into a super-issue to make tracking easier.

The core problem is that we need to "autopromote" literal types to concrete types in certain situations.

Tasks

@willghatch
Copy link
Contributor

At this point we have proper IntLiteral and FloatLiteral. The nonmaterializable feature is ready for similar behaviors by things like StringLiteral and ListLiteral. But I don't think those necessarily need compiler-specific support -- I think it can all be implemented now in the stdlib. I tried making our current StringLiteral be @nonmaterializable(String), and it gave a lot of errors where StringLiteral is used dynamically in the stdlib. So I think this can be handed off to the stdlib team now. Thoughts @JoeLoser @Mogball ?

@willghatch
Copy link
Contributor

Well, this specific issue has all of its sub-issues completed, so I'm going to close this one. I think we should make issues to make these other literal types be nonmaterializable and convert to their dynamic counterpart, but I still think that that can move to stdlib now.

@ematejska ematejska added the mojo-repo Tag all issues with this label label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mojo Issues that are related to mojo mojo-lang Tag for all issues related to language. mojo-repo Tag all issues with this label mojo-stdlib Tag for issues related to standard library
Projects
None yet
Development

No branches or pull requests

3 participants