-
Notifications
You must be signed in to change notification settings - Fork 46
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
Function gets constrained by callers #25
Comments
Interesting. Must be missing a deep type copy somewhere, thanks for finding this. |
Per conversation on PR #30: tuples, pids, and receivers still need to be accounted for in |
Started looking at this and found a new bug:
While
type (respectively) to
But should type to
and
|
I was initially thinking this was failing due to a lack of evidence for the inferencer to make a decision as to the type of
|
Good find. This might explain why I failed to produce a failing test case for receives and spawns earlier. |
Still investigating but my current hypothesis is that this might be a problem due to incomplete use of generalization. Some reference cells might contain the same name instead of linking to each other or using the same reference cell. Going to take some digging to check/confirm though. |
Got it mostly narrowed down, just cleaning up some code and dialyzer errors on > 18.3 (building 19.1 as I type this up). Basics of it was that copying a receiver wasn't ensuring that the receive type and the receiver's expression were guaranteed to use the same reference cells for the same type variables. This meant that unification during the typing of an application wouldn't affect the receive type and would thus lead to incorrect typing. I think my solution's a little rough around the edges and may yet have some holes but there's progress. Once records (row polymorphism) is working it's probably worth a full rewrite of the typer incorporating some cleanup as discussed elsewhere around using exceptions. |
Consider this example:
This fails unexpectedly with
{error,{cannot_unify,list_tests,12,t_atom,t_int}}
.The fact that we applied an atom to is_empty, should not specialize the function to only act on atoms.
The text was updated successfully, but these errors were encountered: