Skip to content

exhaustiveness checking and trans fail on this pattern #2111

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
nikomatsakis opened this issue Apr 2, 2012 · 2 comments
Closed

exhaustiveness checking and trans fail on this pattern #2111

nikomatsakis opened this issue Apr 2, 2012 · 2 comments
Labels
A-type-system Area: Type system

Comments

@nikomatsakis
Copy link
Contributor

This test case:

fn foo(a: option<uint>, b: option<uint>) {
  alt (a,b) {
    (some(a), some(b)) if a == b { }
    (some(_), none) |
    (none, some(_)) { }
  }
}

when compiled (1) does not fail exhaustiveness checking (it should) and (2) causes an option::get() failure in trans (possibly as a result of problem #1?)

@ghost ghost assigned marijnh Apr 2, 2012
@marijnh marijnh closed this as completed Apr 3, 2012
@marijnh marijnh reopened this Apr 3, 2012
@marijnh
Copy link
Contributor

marijnh commented Apr 3, 2012

That patch makes the check much more reliable, but has some false positives. Not merging it for now.

marijnh added a commit that referenced this issue Apr 25, 2012
@catamorphism
Copy link
Contributor

Correctly rejected with a non-exhaustive pattern error as of 6/21/2012. Added test case; closing.

celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

3 participants