aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 9c553a0092..7448fd149c 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -6446,7 +6446,12 @@ fn analyzeCall(
.extern_fn => return sema.fail(block, call_src, "{s} call of extern function", .{
@as([]const u8, if (is_comptime_call) "comptime" else "inline"),
}),
- else => unreachable,
+ else => {
+ assert(callee_ty.isPtrAtRuntime());
+ return sema.fail(block, call_src, "{s} call of function pointer", .{
+ @as([]const u8, if (is_comptime_call) "comptime" else "inline"),
+ });
+ },
};
if (func_ty_info.is_var_args) {
return sema.fail(block, call_src, "{s} call of variadic function", .{