tcSubsumes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

tcSubsumes

Richard Eisenberg-4
Hi Simon,

Could you take a look at TcSimplify.tcSubsumes? This relatively new function pushes the TcLevel when calling tcSubType, but then doesn't set the TcLevel when calling the solver. Inexplicably, this sometimes works -- even passing the testsuite. Somehow, my work caused this to fail. I fixed it by setting the TcLevel before calling the solver.

Two questions:

1. Is this a reasonable fix?

2. (optional) How is it possible that this didn't fail drastically often?

Note (to author / reviewers of this function): my astonishment isn't that this error crept into the codebase -- I've done similar many many times. My astonishment is how the testsuite didn't find this error forthwith.

Thanks,
Richard
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

RE: tcSubsumes

GHC - devs mailing list
Richard

It's clearly wrong as it is, but I suggest you that you make tcSubsumes use captureConstraints rather than pushLevelAndCaptureConstratints.  That's what solveEqualities does, after all.

Simon

| -----Original Message-----
| From: Richard Eisenberg [mailto:[hidden email]]
| Sent: 26 October 2017 23:12
| To: Simon Peyton Jones <[hidden email]>
| Cc: ghc-devs <[hidden email]>
| Subject: tcSubsumes
|
| Hi Simon,
|
| Could you take a look at TcSimplify.tcSubsumes? This relatively new
| function pushes the TcLevel when calling tcSubType, but then doesn't set
| the TcLevel when calling the solver. Inexplicably, this sometimes works -
| - even passing the testsuite. Somehow, my work caused this to fail. I
| fixed it by setting the TcLevel before calling the solver.
|
| Two questions:
|
| 1. Is this a reasonable fix?
|
| 2. (optional) How is it possible that this didn't fail drastically often?
|
| Note (to author / reviewers of this function): my astonishment isn't that
| this error crept into the codebase -- I've done similar many many times.
| My astonishment is how the testsuite didn't find this error forthwith.
|
| Thanks,
| Richard
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs