-
Notifications
You must be signed in to change notification settings - Fork 35
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
Handling aliases correctly #32
Comments
Gradualizer currently doesn't do type refinement based on patterns. So even though I'd like Gradualizer to do more type refinement in the future, but I'm afraid it's not at the top of my todo list. If you disagree and think that this is a superimportant feature, please let me know. I might be persuaded to bump it up the list. |
Shouldn't solving the constraints be enough in this case? It's not implemented, but from the pattern |
@zuiderkwast, your suggestion implies that we can infer the type of the pattern. I suppose we could attempt to do that, but it's not something we currently do. |
I just want to mention that I've come across this problem myself now. I didn't write the code but I've type checked a few modules which use this idiom. |
Singleton integers, atoms and nil are used for type refinement. Recursively type refinement in tuples. Only when there are no guards. Annotated types are also handled. Also limit upper bounds on "aliases" i.e. variables bound in 'match' patterns on the form `Pattern1 = Pattern2` by inferring types from the patterns. Two extra types are returned by add_type_pat/4. Fixes #91 Fixes #32
Singleton integers, atoms and nil are used for type refinement. Recursively type refinement in tuples. Only when there are no guards. Annotated types are also handled. Also limit upper bounds on "aliases" i.e. variables bound in 'match' patterns on the form `Pattern1 = Pattern2` by inferring types from the patterns. Two extra types are returned by add_type_pat/4. Fixes #91 Fixes #32
Singleton integers, atoms and nil are used for type refinement. Recursively type refinement in tuples. Only when there are no guards. Annotated types are also handled. Also limit upper bounds on "aliases" i.e. variables bound in 'match' patterns on the form `Pattern1 = Pattern2` by inferring types from the patterns. Two extra types are returned by add_type_pat/4. Fixes josefs#91 Fixes josefs#32
Currently the following code
gives me the error
The text was updated successfully, but these errors were encountered: