From 77ac864995d977ad38a35b8a7937aca355a18f9c Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 4 Oct 2024 18:01:57 +0200 Subject: [PATCH] Unexpected compile error using a typed constant with `copysign` #1517 --- lib/std/math/math.c3 | 2 +- releasenotes.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/math/math.c3 b/lib/std/math/math.c3 index 536fc92de..e3c7d45b9 100644 --- a/lib/std/math/math.c3 +++ b/lib/std/math/math.c3 @@ -264,7 +264,7 @@ macro clamp(x, lower, upper) => $$max(($typeof(x))lower, $$min(x, ($typeof(x))up /** * @require values::@is_promotable_to_floatlike(mag) `The input must be a number value or float vector` - * @require values::@assign_to(sgn, values::promote_int(mag)) + * @require $defined(($typeof(values::promote_int(mag)))mag) `It's not possible to cast the sign to the type of the magnitude` **/ macro copysign(mag, sgn) => $$copysign(values::promote_int_same(mag, sgn), ($typeof(values::promote_int_same(mag, sgn)))sgn); diff --git a/releasenotes.md b/releasenotes.md index d9f5d7833..9dda9ae88 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -9,6 +9,7 @@ ### Fixes - `Unsupported int[*] $x = { 1, 2, 3, 4 }` #1489. +- Unexpected compile error using a typed constant with `copysign` #1517 ### Stdlib changes - Remove unintended print of `char[]` as String