You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (local->type->kind!=Type_Kind_Array&&type_size_of(local->type) ==0) {
3546
3590
ERROR(local->token->pos, "Function parameters cannot have 'void' as their type.");
3547
3591
}
3592
+
3593
+
if (local->type->kind==Type_Kind_Array&&type_size_of(local->type) >= 128) {
3594
+
onyx_report_warning(local->token->pos, "Since arrays are passed by value, this array parameter would copy %d bytes per function call. Unless this is what you want, you should make this parameter a slice instead ('[] %s').",
3595
+
type_size_of(local->type),
3596
+
type_get_name(local->type->Array.elem)
3597
+
);
3598
+
}
3548
3599
}
3549
3600
3550
3601
if (func->return_type!=NULL) CHECK(type, &func->return_type);
0 commit comments