The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
15 lines
274 B
Zig
15 lines
274 B
Zig
const Foo = struct {
|
|
field: i32,
|
|
};
|
|
const x = Foo{ .field = 1 } + Foo{ .field = 2 };
|
|
|
|
export fn entry() usize {
|
|
return @sizeOf(@TypeOf(x));
|
|
}
|
|
|
|
// error
|
|
// backend=llvm
|
|
// target=native
|
|
//
|
|
// :4:29: error: invalid operands to binary expression: 'struct' and 'struct'
|