diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-01-05 05:27:48 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-01-09 06:46:47 +0000 |
| commit | e9bd2d45d4bbaf7eff7e95bc3ef7a0123b66a103 (patch) | |
| tree | da18bc40935c7dd9698d792eae3d102fa0ad67ae /test/cases/compile_errors/bad_usage_of_call.zig | |
| parent | 3f95003d4c57650f9b4779f55c8d7368b137337c (diff) | |
| download | zig-e9bd2d45d4bbaf7eff7e95bc3ef7a0123b66a103.tar.gz zig-e9bd2d45d4bbaf7eff7e95bc3ef7a0123b66a103.zip | |
Sema: rewrite semantic analysis of function calls
This rewrite improves some error messages, hugely simplifies the logic,
and fixes several bugs. One of these bugs is technically a new rule
which Andrew and I agreed on: if a parameter has a comptime-only type
but is not declared `comptime`, then the corresponding call argument
should not be *evaluated* at comptime; only resolved. Implementing this
required changing how function types work a little, which in turn
required allowing a new kind of function coercion for some generic use
cases: function coercions are now allowed to implicitly *remove*
`comptime` annotations from parameters with comptime-only types. This is
okay because removing the annotation affects only the call site.
Resolves: #22262
Diffstat (limited to 'test/cases/compile_errors/bad_usage_of_call.zig')
| -rw-r--r-- | test/cases/compile_errors/bad_usage_of_call.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/cases/compile_errors/bad_usage_of_call.zig b/test/cases/compile_errors/bad_usage_of_call.zig index 3b7abe53f6..6eca5d7e3d 100644 --- a/test/cases/compile_errors/bad_usage_of_call.zig +++ b/test/cases/compile_errors/bad_usage_of_call.zig @@ -42,8 +42,8 @@ noinline fn dummy2() void {} // :2:23: error: expected a tuple, found 'void' // :5:21: error: unable to perform 'never_inline' call at compile-time // :8:21: error: unable to perform 'never_tail' call at compile-time -// :11:5: error: 'never_inline' call of inline function +// :11:5: error: cannot perform inline call with 'never_inline' modifier // :15:26: error: modifier 'compile_time' requires a comptime-known function -// :18:9: error: 'always_inline' call of noinline function -// :21:9: error: 'always_inline' call of noinline function +// :18:9: error: inline call of noinline function +// :21:9: error: inline call of noinline function // :26:27: error: modifier 'always_inline' requires a comptime-known function |
