-
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
Fix map type inference #457
Conversation
See josefs#432 for some context.
@@ -3,11 +3,19 @@ | |||
-compile([nowarn_unused_function]). | |||
-export([not_good/1]). | |||
|
|||
-spec good(#{ good := A }) -> A. | |||
good(#{ good := X }) -> X. | |||
-gradualizer([infer]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test suite is a little disorganized wrt infer
. But I think it would be helpful to have separate files for things which are tested with infer
enabled and have infer
in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll split out the parts relying on infer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general. The fix looks simpler than I though.
not_good(M). | ||
|
||
-spec kaboom2() -> integer(). | ||
kaboom2() -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test machinery makes use of the number of exported functions and compares it to the number of failures per test suite. The idea is that all the 'should fail' functions should be exported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware of the mechanism using exports. The thing is this was failing when it was broken - with the fix, it doesn't anymore. Another reason to split out the test into a corresponding should_pass
test.
The example comes from josefs#378.
…ariant_map_keys_fail.erl
30f3b71
to
8fe9691
Compare
This fixes #432 and fixes #378.