diff options
| author | jakubtomsu <66876057+jakubtomsu@users.noreply.github.com> | 2023-11-25 13:20:34 +0100 |
|---|---|---|
| committer | jakubtomsu <66876057+jakubtomsu@users.noreply.github.com> | 2023-11-25 13:20:34 +0100 |
| commit | 3c25d93eae4e5aac76c09d7018cf8a440eab700b (patch) | |
| tree | 95a58279a67afea1ac3c5530aa4beb40786b56e3 | |
| parent | cabaac5a682ca3ce39b52790e6c5acb1f279569b (diff) | |
Check for variadic param default val
| -rw-r--r-- | src/check_type.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index d66b196bc..33881aa8f 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1510,8 +1510,10 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para } if (default_value != nullptr) { - if (type_expr != nullptr && type_expr->kind == Ast_TypeidType) { + if (type_expr->kind == Ast_TypeidType) { error(type_expr, "A type parameter may not have a default value"); + } else if (is_variadic) { + error(type_expr, "A variadic parameter may not have a default value"); } else { param_value = handle_parameter_value(ctx, type, nullptr, default_value, true); } |