Deprecation of @assignable_to

This commit is contained in:
Christoffer Lerno
2025-08-26 13:21:42 +02:00
parent 1634217fc4
commit cb17cfff7d
18 changed files with 46 additions and 37 deletions

View File

@@ -252,8 +252,8 @@ macro @ceil($input) @const => $$ceil($input);
@return "lower if x < lower, upper if x > upper, otherwise return x."
@require types::is_numerical($typeof(x)) : `The input must be a numerical value or numerical vector`
@require values::@assign_to(lower, x) : `The lower bound must be convertable to the value type.`
@require values::@assign_to(upper, x) : `The upper bound must be convertable to the value type.`
@require $defined(x = lower) : `The lower bound must be convertable to the value type.`
@require $defined(x = upper) : `The upper bound must be convertable to the value type.`
*>
macro clamp(x, lower, upper) => $$max(($typeof(x))lower, $$min(x, ($typeof(x))upper));
@@ -413,7 +413,7 @@ macro nearbyint(x) => $$nearbyint(x);
<*
@require values::@is_promotable_to_floatlike(x) : `The input must be a number or a float vector`
@require @assignable_to(exp, $typeof(values::promote_int(x))) || values::@is_int(exp) : `The input must be an integer, castable to the type of x`
@require $defined($typeof(values::promote_int(x)) v = exp) || values::@is_int(exp) : `The input must be an integer, castable to the type of x`
*>
macro pow(x, exp)
{

View File

@@ -133,7 +133,7 @@ macro double next_double(random)
}
// True if the value is a Random.
macro bool is_random(random) => @assignable_to(random, Random);
macro bool is_random(random) => $defined(Random r = random);
macro uint128 @long_to_int128(#function) => (uint128)#function << 64 + #function;
macro ulong @int_to_long(#function) => (ulong)#function << 32 + #function;