Skip to content
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

Pattern match failure in do expression at TypeCheckCommon.hs:144:15-21 #11

Open
mpickering opened this issue Jun 6, 2017 · 1 comment

Comments

@mpickering
Copy link

The following program triggers an error due to an incomplete pattern match. I haven't
dug into why yet. The crucial part is that Card is a datatype which contains a computation.

--- start of standard stuff ---
on : {X -> {X -> Y} -> Y}
on x f = f x

data S = S (List Card)  

data Card = Card { Unit }

interface State = get : S | put : S -> Unit

drawCardDeck : [State]Card
drawCardDeck! =
	on get! { (S (cons top deck)) -> put (S deck); top }

main : { [Console]Unit }
main! = unit
lucques pushed a commit to lucques/frankjnr that referenced this issue Jun 28, 2017
…github.com/mpickering) at cmcl#11.

The bug was an occurring pattern match failure in the compiler code, very likely caused by a violation of an invariant. It turned out that implicit [£] arguments were not considered correctly (fixed now) which then must have violated this invariant.
@lucques
Copy link
Collaborator

lucques commented Jun 28, 2017

Hi Matthew, having made some changes to the compiler (not related to this issue), the problem still occured in my working state 93f2559. I noticed that there was a bug in assigning (implicit, explicit) [£]'s to the definitions of S and Card, fixing this removed the issue: 4101e28
The same error came up again though, due to a bug in the unification algorithm, now fixed in 376bcf5 (I hope I did not overlook anything fixing it).
We'll probably pull in my branch soon to the master branch so the issue (at least this particular instance) can be seen as closed.
Cheers, Lukas

lucques added a commit to lucques/frankjnr that referenced this issue Jun 29, 2017
…github.com/mpickering) at cmcl#11.

The bug was an occurring pattern match failure in the compiler code, very likely caused by a violation of an invariant. It turned out that implicit [£] arguments were not considered correctly (fixed now) which then must have violated this invariant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants