-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improvements to fromList key deduplication simplification #329
Conversation
@@ -365,6 +365,26 @@ a = Dict.fromList [ ( key, v0 ), ( key, v1 ) ] | |||
|> Review.Test.whenFixed """module A exposing (..) | |||
import Dict | |||
a = Dict.fromList [ ( key, v1 ) ] | |||
""" | |||
] | |||
, test "should replace Dict.fromList [ ( key, v0 ), thing, ( key, v1 ) ] by Dict.fromList [ thing, ( key, v1 ) ]" <| |
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.
Really good refactors and fixes.
I keep missing cases like that so I'll try to test on more examples next time :)
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.
No worries, I only discovered it while refactoring the code and thinking something was odd. Think of what you can, and we can fix based on feedback if necessary 🙂
I noticed there was a bug where some entries would be removed: We did
Dict.fromList [ ( key, a ), thing, ( key, b ) ] -> Dict.fromList [ ( key, b ) ]
which is incorrectly removingthing
.Other improvements:
allDifferent
checks now aborts early when finding an errorPR can be reviewed commit by commit.