Sema: add error for capturing a runtime value outside of function scope

Closes #13104
This commit is contained in:
Veikka Tuominen
2022-10-08 15:29:05 +03:00
parent b5c0a797a7
commit 3ccd4907fb
2 changed files with 42 additions and 2 deletions

View File

@@ -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