diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-07 00:20:26 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-07 00:28:37 -0500 |
| commit | bb39e503c0179b18c4e440bae021e786c70deb06 (patch) | |
| tree | 9f65059a937a5377435f04ed1defad51d0224315 /test/compile_errors.zig | |
| parent | ad438cfd40aba682a0bcd88ed607c2cbd378f647 (diff) | |
| download | zig-bb39e503c0179b18c4e440bae021e786c70deb06.tar.gz zig-bb39e503c0179b18c4e440bae021e786c70deb06.zip | |
fix struct inside function referencing local const
closes #672
the crash and compile errors are fixed but structs
inside functions still get named after the functions
they're in. this will be fixed later.
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 60e5c3614d..ec3ec78664 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,6 +1,18 @@ const tests = @import("tests.zig"); pub fn addCases(cases: &tests.CompileErrorContext) { + cases.add("bad identifier in function with struct defined inside function which references local const", + \\export fn entry() { + \\ const BlockKind = u32; + \\ + \\ const Block = struct { + \\ kind: BlockKind, + \\ }; + \\ + \\ bogus; + \\} + , ".tmp_source.zig:8:5: error: use of undeclared identifier 'bogus'"); + cases.add("labeled break not found", \\export fn entry() { \\ blah: while (true) { |
