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

checker: fix checking for option matching with non-option #20673

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Jan 27, 2024

Fix #20663

enum Test {
    a
    b
}

fn optional() ?Test {
    return none
}

fn optional2() ?Test {
    return .a
}

fn main() {
    match optional() {
        .a { assert false }
        else { assert true }
    }

	match optional2() {
        .a { }
        else { }
    }
}

@felipensp felipensp added the Tests To Fix This PR requiring only test fixes. label Jan 27, 2024
@felipensp felipensp marked this pull request as ready for review January 28, 2024 17:45
@felipensp felipensp removed the Tests To Fix This PR requiring only test fixes. label Jan 28, 2024
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit d8b158b into vlang:master Jan 29, 2024
54 checks passed
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.

Optional enum match C error
2 participants