-
Notifications
You must be signed in to change notification settings - Fork 154
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
Polymorphic literals #3348
Comments
There seems to be two PRs to attempt to implemented this (#3360 and #3252) however I would argue that how they work at the interpreter level is flawed, or at least incomplete. Their implementation avoids converting the literal to the actual type at creation and just keeps it as an integer value. Operators like To make this sane I think the interpreter needs a single, generic number type (ala python) or we do it the statically typed way and implement monomorphization, or dictionary passing so that we know how to convert the integer literal at its creation. (One way to think of this is that the current implementation of constraints cheat a bit by utilizing the dynamic type in the interpreter to choose which implementation of |
This issue has had no recent activity and will be closed soon. |
This epic will be complete when we can use integer literals in different contexts in a type safe way across flux. For example
Polymorphic literals must also be supported in lambda functions. The following query should work regardless of whether
r._value
is a float or an intThe text was updated successfully, but these errors were encountered: