Sema: add error for capturing a runtime value outside of function scope
Closes #13104
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export fn entry(y: u8) void {
|
||||
const Thing = struct {
|
||||
y: u8 = y,
|
||||
};
|
||||
_ = @sizeOf(Thing);
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :3:17: error: 'y' not accessible outside function scope
|
||||
Reference in New Issue
Block a user