aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-08-11 13:43:35 +0100
committergingerBill <bill@gingerbill.org>2022-08-11 13:43:35 +0100
commit70dc0c15fd244bdc4a769b0d91b50ecc210bca65 (patch)
treee91f4be7b4704d70c3bae91a7bc92fa9ffdf9d20 /src/check_builtin.cpp
parent9eeed9d5bde1348d16d3c3790ba3178f3e0bb09d (diff)
Improve type hint for #load to allow for string types
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index b0c7f8d4b..122d3a461 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -1196,10 +1196,14 @@ LoadDirectiveResult check_load_directive(CheckerContext *c, Operand *operand, As
GB_ASSERT(o.value.kind == ExactValue_String);
+ operand->type = t_u8_slice;
+ if (type_hint && is_type_string(type_hint)) {
+ operand->type = type_hint;
+ }
+ operand->mode = Addressing_Constant;
+
LoadFileCache *cache = nullptr;
if (cache_load_file_directive(c, call, o.value.value_string, err_on_not_found, &cache)) {
- operand->type = t_u8_slice;
- operand->mode = Addressing_Constant;
operand->value = exact_value_string(cache->data);
return LoadDirective_Success;
}