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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user