diff options
| author | gingerBill <bill@gingerbill.org> | 2020-11-20 16:01:59 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-11-20 16:01:59 +0000 |
| commit | 6416a6f39cce4c65c80e29bb4ff4b93a3e463947 (patch) | |
| tree | 2bf6668068ab0516998fb6bde144a3d4a69bac9e /src/types.cpp | |
| parent | 87956676f52a56db98e263d1074b490b71141f0b (diff) | |
Allow string literals for `[N]byte`
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 1147beb33..8c39b9979 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1221,6 +1221,13 @@ bool is_type_u8_slice(Type *t) { } return false; } +bool is_type_u8_array(Type *t) { + t = base_type(t); + if (t->kind == Type_Array) { + return is_type_u8(t->Array.elem); + } + return false; +} bool is_type_u8_ptr(Type *t) { t = base_type(t); if (t->kind == Type_Pointer) { |