-
Notifications
You must be signed in to change notification settings - Fork 46
[ fix #306 ] Correctly error on dot patterns corresponding to module arguments #439
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
Conversation
4670f85 to
bb31100
Compare
bb31100 to
b565acd
Compare
Delay applying getContextArgs until after we have checked for dot patterns Also stop throwing __IMPOSSIBLE__ on instances inside modules
b565acd to
003d0df
Compare
|
Thank you very much for the PR! |
|
It looks like the CI is failing because of the golden output for |
|
Oops, should be fixed now |
checkForced now also checks the pattern is non-erased, so that should probably be made clear with the name
Actually, given we check for dotted patterns earlier in compileClause', I don't think there is any need to checkNonErasedForced in compilePats?
01e7af0 to
1b6ca61
Compare
1b6ca61 to
8125ca2
Compare
|
Oh oops - I just realised I missed compiling any remaining dot patterns to wildcards... The current behaviour isn't the end of the world (just hits |
|
Oh I should've given it a bit more time then. Yes, please open a new PR if you want! Compiling the remaining dot patterns to wildcards makes sense, or in the case of module parameters you could also use the name of the module parameter (even though the argument will be unused). Or a third option would be to prefix the name of the module parameter with an underscore, which seems to be standard Haskell practice to indicate an unused argument that still has a name. |
We delay applying
parsfromgetContextArgsuntil after we have checked for dot patterns.Relaxes the dot pattern error to only apply to arguments compiled to (implicit or explicit)
forallsAlso stop throwing
__IMPOSSIBLE__on instances inside modules.