-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Description
const Value = struct {
ref: u32 = 2, // commenting works
kind: union(enum) {
// any of these 3 work
// None,
// None: bool,
// None: u32,
None: usize,
Bool: bool,
},
};
test "" {
// using const here works
var True = Value{
.kind = .{ .Bool = true },
};
assert(True.ref == 2);
assert(True.kind.Bool);
}Test [1/1] test ""...access of inactive union field
./test.zig:32:21: 0x206751 in test "" (test)
assert(True.kind.Bool);
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviormiscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.