mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
Module: improve source spans for initializers and var types
```zig
const U = union { foo: u32, bar: u32 };
test {
var a = U{ .foo = 1213, .bar = 1123 };
_ = a;
}
test {
var a: (123 + 5238094) = 0;
_ = a;
}
```
before:
```
:30: note: additional initializer here
var a = U{ .foo = 1213, .bar = 1123 };
^~~
:12: error: expected type 'type', found 'comptime_int'
var a: (123 + 5238094) = 0;
^
```
after:
```
:30: note: additional initializer here
var a = U{ .foo = 1213, .bar = 1123 };
~^~~~~~~~~~
:12: error: expected type 'type', found 'comptime_int'
var a: (123 + 5238094) = 0;
^~~~~~~~~~~~~~~
```
This commit is contained in:
parent
1463144fc8
commit
cf207df592
2 changed files with 38 additions and 33 deletions
16
src/Sema.zig
16
src/Sema.zig
Loading…
Add table
Add a link
Reference in a new issue