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

Inline Records On Adt's Ignore exhaustiveness checking #2219

Open
spotandjake opened this issue Dec 23, 2024 · 0 comments
Open

Inline Records On Adt's Ignore exhaustiveness checking #2219

spotandjake opened this issue Dec 23, 2024 · 0 comments

Comments

@spotandjake
Copy link
Member

spotandjake commented Dec 23, 2024

I was working on #2217 and noticed that we do not currently have any printing logic for inline records, when I went to test what happens I noticed that somehow once inline records are introduced we don't emit an exhaustiveness error at all which is rather interesting behaviour, see below for an example:

module Test

enum Test {
  Case1{ v: Void, },
  Case2{ v: Void, },
}
let n = Case2{ v: void }
match (n) {
  Case1{ _ } => void,
}

The code above compiles just fine and doesn't cause an exhaustiveness error even though it is clearly non exhaustive, this is extremely interesting as this isn't just a case of the record matches not being exhaustive but the actual constructor check not being exhuastive.

To the original issue as well we do not implement printing logic in Printpat.re for inline records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant