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

Showcase pattern matching bug #214

Merged
merged 2 commits into from
Dec 10, 2020
Merged

Showcase pattern matching bug #214

merged 2 commits into from
Dec 10, 2020

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Dec 10, 2020

Currently doesn't build because it adds a test case which showcases a pattern matching bug:

enum Inst { A, Unknown }

pub fn works() {
    let program = [];
    let inst = match "a" { "a" => Inst::A, _ => Inst::Unknown };
    program.push(inst);
    assert_eq!(program, [Inst::A]);
}

pub fn broken() {
    let program = [];
    program.push(match "a" { "a" => Inst::A, _ => Inst::Unknown });
    assert_eq!(program, [Inst::A]);
}

pub fn main() {
    works();
    broken();
} 

@udoprog udoprog added the bug Something isn't working label Dec 10, 2020
@udoprog udoprog merged commit 7650977 into main Dec 10, 2020
@udoprog udoprog deleted the pat-match-bug branch December 10, 2020 20:46
@udoprog udoprog added the changelog Issue has been added to the changelog label Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog Issue has been added to the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant