mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-10 18:09:32 +00:00
Merge pull request #6948 from tf2spi/6866-poly-const-float-convert
Convert poly const int to f64 when needed
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user