-
Notifications
You must be signed in to change notification settings - Fork 175
Case splitting breaks with ghc-7.10 unless I use -fdefer-type-errors #438
Comments
I don't get how this ever worked typecheckModule is documented to throw exceptions when type checking fails yet the test suite used to work :/ |
@DanielG I don't think this is 7.10 specific. I have the same problem with 7.8: case split doesn't work even if I have some holes (and no other errors). I also found that it's because |
Seems to work now, no idea what I did to break and then fix it. [EDIT: nope still broken] |
I'll get to that issue, I was looking into it yesterday and then got sidetracked with other stuff. I can't explain it as of yet. |
I have started working on this issue again. The first thing I found out is that in 7.10 they introduced a new compiler option to make typed holes silent. This needs to be on in order to get the case splitting working in presence of holes. I have changed the code to set this up in 7.10 at serras@f076e22 However, the bad news is that it doesn't work yet in all situations. If you |
This GHC Trac issue might be relevant. |
Awesome, thanks! |
@serras what do you mean did I find it at another point? |
@serras so you have time to look at this with me at some point next week, I'd really like to get ghc-mod released by the end of next week and this issue is a huge blocker. |
I am very sorry about not being very active. Right now I don't have much time to spend on |
Figured out what was causing all the case-split/refine stuff to break, it's my favorite problem cache invalidation at work again. Should be fixed in master now, see 2e4c2b5. |
@serras In GhcMod.CaseSplit.splits you catch all exceptions and return an empty result if any happen. With ghc-7.10 it seems that type errors are thrown as exceptions (not sure if that was the case before too) as if I remove the exception handler I get a bunch of type errors when running the test suite against
"case split"/"works with case expressions"
.If i add
-fdefer-type-errors
using-g
everything works as it should.I'm not sure what would be the best way to fix this I'd rather not have to add a hack to add
-fdefer-type-errors
do the DynFlags if we're doing case split. If you can confirm that ghc used to just log type errors instead of throwing them then I guess catching and ignoring the relevant exceptions might work?The text was updated successfully, but these errors were encountered: