From 6416a6f39cce4c65c80e29bb4ff4b93a3e463947 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 20 Nov 2020 16:01:59 +0000 Subject: Allow string literals for `[N]byte` --- src/ir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 819442030..e8378bb97 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7801,7 +7801,9 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) { if (tv.value.kind != ExactValue_Invalid) { // NOTE(bill): Edge case - if (tv.value.kind != ExactValue_Compound && + if (is_type_u8_array(tv.type) && tv.value.kind == ExactValue_String) { + return ir_add_module_constant(proc->module, tv.type, tv.value); + } else if (tv.value.kind != ExactValue_Compound && is_type_array(tv.type)) { Type *elem = core_array_type(tv.type); ExactValue value = convert_exact_value_for_type(tv.value, elem); -- cgit v1.2.3