mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
Check for variadic param default val
This commit is contained in:
+3
-1
@@ -1510,8 +1510,10 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (default_value != nullptr) {
|
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");
|
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 {
|
} else {
|
||||||
param_value = handle_parameter_value(ctx, type, nullptr, default_value, true);
|
param_value = handle_parameter_value(ctx, type, nullptr, default_value, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user