forked from cmcl/frankjnr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the pattern-match-fail-bug discovered by M. Pickering (https://…
…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.
- Loading branch information
Showing
5 changed files
with
159 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Regression for the fixed bug discovered by M. Pickering | ||
-- (https://github.com/mpickering) at https://github.com/cmcl/frankjnr/issues/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 which then must have violated this | ||
-- invariant. | ||
-- #desc This checks the code which used to cause a 'pattern match fail' in the compiler code | ||
-- #return unit | ||
|
||
--- 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 |