From 1ab2253ff8dc745c1c1096b3762c14159419b536 Mon Sep 17 00:00:00 2001 From: misomosi Date: Fri, 3 Jul 2026 11:05:31 -0400 Subject: [PATCH] Convert poly const int to f64 when needed --- src/check_type.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/check_type.cpp b/src/check_type.cpp index 89c663ec6..b1994311e 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -2174,6 +2174,10 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para if (!valid) { if (op.mode == Addressing_Constant) { poly_const = op.value; + if (poly_const.kind == ExactValue_Integer && is_type_float(type)) { + poly_const.kind = ExactValue_Float; + poly_const.value_float = big_int_to_f64(&poly_const.value_integer); + } } else { if (!ctx->in_proc_group) { error(op.expr, "Expected a constant value for this polymorphic name parameter, got %s", expr_to_string(op.expr));