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

implicit cast from @EnumTagType(TheUnion) to &const TheUnion #654

andrewrk opened this Issue Dec 8, 2017 · 0 comments


None yet
1 participant
Copy link

andrewrk commented Dec 8, 2017

const assert = @import("std").debug.assert;

const TheUnion = union(enum) {
    Item2: i32,

test "implicit cast from @EnumTagType(TheUnion) to &const TheUnion" {

fn foo(value: &const TheUnion) {
    assert(*value == TheUnion.Item1);

@andrewrk andrewrk added the enhancement label Dec 8, 2017

@andrewrk andrewrk added this to the 0.2.0 milestone Dec 8, 2017

@andrewrk andrewrk closed this in 756a218 Dec 8, 2017

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