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 completeness: Handle structures under union constructors #700

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

Alasdair
Copy link
Collaborator

@Alasdair Alasdair commented Sep 7, 2024

The following now generates a correct counterexample:

enum E = {A, B}

struct Foo = { bar : E }

val main : unit -> unit

function main() = {
    let x : Foo = struct { bar = B };
    match Some(x) {
      Some(struct { bar = A }) => (),
      None()  => (),
    }
}

whereas previously it would just mark the pattern as potentially incomplete and continue.

The following now generates a correct counterexample:
```
enum E = {A, B}

struct Foo = { bar : E }

val main : unit -> unit

function main() = {
    let x : Foo = struct { bar = B };
    match Some(x) {
      Some(struct { bar = A }) => (),
      None()  => (),
    }
}
```
whereas previously it would just mark the pattern as potentially
incomplete and continue.
Copy link

github-actions bot commented Sep 7, 2024

Test Results

    9 files  ±0     21 suites  ±0   0s ⏱️ ±0s
  681 tests +1    681 ✅ +1  0 💤 ±0  0 ❌ ±0 
2 143 runs  +1  2 142 ✅ +1  1 💤 ±0  0 ❌ ±0 

Results for commit b905e9b. ± Comparison against base commit 8d4b9d8.

♻️ This comment has been updated with latest results.

@Alasdair Alasdair merged commit 8997056 into sail2 Sep 7, 2024
9 checks passed
@Alasdair Alasdair deleted the struct_opt_pc branch September 7, 2024 03:20
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.

1 participant