Is there a compiler bug here? Or just intentional design?

const U = union(E) {
    foo,
    bar,
};
var v: U = .foo;
pub fn main() void {
    // This one also compiles.
    switch (v) {
        .foo => {},
        .bar => {},
        else => {},
    }
}

So this piece of code can actually compile! I’m really happy about it!

I once designed a kind of ‘configurable enum’ type for customization points. At the time, I naturally assumed that the code above wouldn’t compile, which bothered me because if the user didn’t add any extra custom enums, the else in the code would (I thought) compile error. So, to solve this imaginary error, I added an extra enum placeholder that would never actually be used. But today I realized that Zig had already considered this real-world scenario and doesn’t compile error for it. Cheers!