Deprecate SomeFn.params

This commit is contained in:
Christoffer Lerno
2025-05-16 21:57:18 +02:00
parent b7ae5dce8b
commit 2f3954a7d9
3 changed files with 4 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
- Add `math::@ceil()` compile time ceil function. #2134
- Improve error message when using keywords as functions/macros/variables #2133.
- Deprecate `MyEnum.elements`.
- Deprecate `SomeFn.params`.
### Fixes
- Assert triggered when casting from `int[2]` to `uint[2]` #2115

View File

@@ -5155,6 +5155,7 @@ static bool sema_expr_rewrite_to_type_property(SemaContext *context, Expr *expr,
case TYPE_PROPERTY_PARAMSOF:
return sema_create_const_paramsof(expr, flat);
case TYPE_PROPERTY_PARAMS:
SEMA_DEPRECATED(expr, "'params' is deprecated, use 'paramsof' instead.");
return sema_create_const_params(expr, flat);
case TYPE_PROPERTY_RETURNS:
expr_rewrite_const_typeid(expr, type_infoptr(flat->pointer->function.signature->rtype)->type);

View File

@@ -6,9 +6,9 @@ fn int hell() { return 1; }
macro print_args($Type)
{
var $params = $Type.params;
var $params = $Type.paramsof;
$foreach $param : $params:
io::printn($param.nameof);
io::printn($param.type.nameof);
$endforeach;
}