diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-07-20 12:30:11 +0300 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-21 12:21:30 -0700 |
| commit | 794beafb9c2c687d993a0933be258a2ccdf0be4f (patch) | |
| tree | ca823524f3c46647f8cd79417faa5f471009f420 /test/behavior/align.zig | |
| parent | 821e4063f9f32f71cce263265fdbacc632bd5af9 (diff) | |
| download | zig-794beafb9c2c687d993a0933be258a2ccdf0be4f.tar.gz zig-794beafb9c2c687d993a0933be258a2ccdf0be4f.zip | |
Sema: validate extern struct field types earlier
`validateExternType` does not require the type to be resolved so we can
check it earlier. Only doing it in `resolveTypeFully` lead to worse or
missing compile errors.
Diffstat (limited to 'test/behavior/align.zig')
| -rw-r--r-- | test/behavior/align.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/behavior/align.zig b/test/behavior/align.zig index ad9a6d9616..d09e97c05b 100644 --- a/test/behavior/align.zig +++ b/test/behavior/align.zig @@ -299,7 +299,7 @@ test "implicitly decreasing fn alignment" { try testImplicitlyDecreaseFnAlign(alignedBig, 5678); } -fn testImplicitlyDecreaseFnAlign(ptr: *align(1) const fn () i32, answer: i32) !void { +fn testImplicitlyDecreaseFnAlign(ptr: *const fn () align(1) i32, answer: i32) !void { try expect(ptr() == answer); } @@ -325,7 +325,7 @@ test "@alignCast functions" { fn fnExpectsOnly1(ptr: *const fn () align(1) i32) i32 { return fnExpects4(@alignCast(4, ptr)); } -fn fnExpects4(ptr: *align(4) const fn () i32) i32 { +fn fnExpects4(ptr: *const fn () align(4) i32) i32 { return ptr(); } fn simple4() align(4) i32 { |
