From bb39e503c0179b18c4e440bae021e786c70deb06 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 Jan 2018 00:20:26 -0500 Subject: 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. --- test/compile_errors.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/compile_errors.zig') 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) { -- cgit v1.2.3