return 0;
}
+ if (from->kind == Type_Kind_Function) {
+ *err_msg = "Can only cast a function to a 'u32'.";
+ return to == &basic_types[Basic_Kind_U32];
+ }
+
if ( (type_is_simd(to) && !type_is_simd(from))
|| (!type_is_simd(to) && type_is_simd(from))) {
*err_msg = "Can only perform a SIMD cast between SIMD types.";
return;
}
+ if (to->kind == Type_Kind_Basic && from->kind == Type_Kind_Function) {
+ WI(NULL, WI_DROP);
+ *pcode = code;
+ return;
+ }
+
i32 fromidx = -1, toidx = -1;
if (from->Basic.flags & Basic_Flag_Pointer || from->kind == Type_Kind_Array) {
fromidx = 10;
node_stack << .{ "start", 0, false };
children_of :: (edges: &$T, name: str) -> Iterator(str) {
- name_copy := new_temp(str);
- *name_copy = name;
-
return iter.concat(
iter.as_iter(edges)
- |> iter.filter(name_copy, (x, n) => x.a == *n)
- |> iter.map(x => x.b),
+ ->filter((x, |name: str|) => x.a == name)
+ ->map(x => x.b),
iter.as_iter(edges)
- |> iter.filter(name_copy, (x, n) => x.b == *n)
- |> iter.map(x => x.a)
+ ->filter((x, |name: str|) => x.b == name)
+ ->map(x => x.a)
);
}