Zig Version
0.12.0-dev.2158+4f2009de1
Steps to Reproduce and Observed Behavior
this is a follow up to #18579 and addresses some changes made in #18173.
these code snippets below were produced by @Techatrix and i think he may address them soon. we noticed this while working on #18579 but decided that it deserves its own issue.
with 0.11.0 the following produced a compile error error set cannot be captured by reference. but now the compiler allows it. i think this is a regression.
comptime {
conste: error{A}!u32=error.A;
ecatch|err|switch (err) {
error.A=>|*foo| {
@compileLog(foo);
},
};
}
// The compiler also doesn't seem to catch the following syntax error:
comptime {
conste: error{A}!u32=error.A;
if (e) |_| {} else|err|switch (err+"I can put anything I want here") {
error.A=> {},
}
}This is a little beyond me so I'm hoping that @Techatrix or another contributor knows what needs to be done here.
Expected Behavior
should be a compile error like it was in 0.11
Zig Version
0.12.0-dev.2158+4f2009de1
Steps to Reproduce and Observed Behavior
this is a follow up to #18579 and addresses some changes made in #18173.
these code snippets below were produced by @Techatrix and i think he may address them soon. we noticed this while working on #18579 but decided that it deserves its own issue.
with 0.11.0 the following produced a compile error
error set cannot be captured by reference. but now the compiler allows it. i think this is a regression.The compiler also doesn't seem to catch the following syntax error:
This is a little beyond me so I'm hoping that @Techatrix or another contributor knows what needs to be done here.
Expected Behavior
should be a compile error like it was in 0.11