From 4439d59105daa74ab04433572e24891630ac0216 Mon Sep 17 00:00:00 2001 From: Michael Kutowski Date: Fri, 19 Nov 2021 00:24:56 +0100 Subject: [PATCH 1/2] add builtin. --- core/slice/slice.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/slice/slice.odin b/core/slice/slice.odin index 1dd777ccc..487dd46c2 100644 --- a/core/slice/slice.odin +++ b/core/slice/slice.odin @@ -20,7 +20,7 @@ swap :: proc(array: $T/[]$E, a, b: int) { } swap_between :: proc(a, b: $T/[]$E) { - n := min(len(a), len(b)) + n := builtin.min(len(a), len(b)) if n >= 0 { ptr_swap_overlapping(&a[0], &b[0], size_of(E)*n) } From 3e04b451062d4e46bd26baad82d7c75ce5e9e1d9 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 19 Nov 2021 12:26:10 +0000 Subject: [PATCH 2/2] Allow cast from float to complex --- src/check_expr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 96ca2d308..3c884d117 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2453,6 +2453,9 @@ bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y) { return true; } + if (is_type_float(src) && is_type_complex(dst)) { + return true; + } if (is_type_float(src) && is_type_quaternion(dst)) { return true; }