// If there are no given arguments to a structure literal, it is treated as a 'zero-value',
// and can be used to create a completely zeroed value of any type.
if (bh_arr_length(sl->args.values) == 0 && bh_arr_length(sl->args.named_values) == 0) {
+ if (sl->type->kind == Type_Kind_Basic &&
+ sl->type->Basic.kind == Basic_Kind_Void) {
+ ERROR(sl->token->pos, "Cannot produce a zero-value for 'void' type.");
+ }
+
AstZeroValue *zv = make_zero_value(context.ast_alloc, sl->token, sl->type);
bh_arr_push(sl->args.values, (AstTyped *) zv);
use runtime {
__runtime_initialize,
Multi_Threading_Enabled,
- _thread_start,
- _thread_exit
}
// Platform supports
__spawn_thread :: (id: i32, tls_base: rawptr, func: (data: rawptr) -> void, data: rawptr) -> bool #foreign "host" "spawn_thread" ---
__kill_thread :: (id: i32) -> i32 #foreign "host" "kill_thread" ---
- #export "_thread_start" _thread_start
- #export "_thread_exit" _thread_exit
+ #export "_thread_start" runtime._thread_start
+ #export "_thread_exit" runtime._thread_exit
}