Skip to content

Add pattern matching for character literals#322

Open
DeSevilla wants to merge 2 commits intogranule-project:mainfrom
DeSevilla:main
Open

Add pattern matching for character literals#322
DeSevilla wants to merge 2 commits intogranule-project:mainfrom
DeSevilla:main

Conversation

@DeSevilla
Copy link
Copy Markdown

Can now define functions and case statements that pattern-match on character literals, e.g. case c of '\n' -> 0. Adds a few tests for this functionality.

…haracter literal patterns in function definitions and case statements
@DeSevilla
Copy link
Copy Markdown
Author

DeSevilla commented Apr 2, 2026

I'm attempting to solve the failing CI/build, but when I run stack test on the current main branch, before any of my commits, I get all the same failed tests. Actually, I get a few more on my machine, mostly because the solver finds some equivalent but slightly different counterexamples for negative tests than are in the golden files. As far as I can tell, my commit doesn't affect any of the existing tests. I'm not sure what I can do about that.

@DeSevilla
Copy link
Copy Markdown
Author

On second look, it seems like all 8 of the tests that failed in CI are the ones listed here as ongoing failures: #294

@jacobpake
Copy link
Copy Markdown
Member

I get a few more on my machine, mostly because the solver finds some equivalent but slightly different counterexamples for negative tests than are in the golden files.

This happens between Z3 versions, if you use 4.15.4 it should match up.

And yes, unfortunately there are 8 failing tests currently in the main branch! Consider it passing as long as that number doesn't increase.

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

Successfully merging this pull request may close these issues.

2 participants