diff options
| author | gingerBill <bill@gingerbill.org> | 2019-08-04 11:02:00 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-08-04 11:02:00 +0100 |
| commit | 37633c1d2a9cc2ab5ae659ffb359f7f56f0457a2 (patch) | |
| tree | 1874f86dfc5cb3b04238926822cfe11c3bbb65da /src/types.cpp | |
| parent | 5877017d30999388c832f6467116336733b607e2 (diff) | |
`intrinsics.type_*` constant evaluation procedures
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 5cf86d6b6..76126f17f 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1307,6 +1307,19 @@ bool is_type_indexable(Type *t) { return false; } +bool is_type_sliceable(Type *t) { + Type *bt = base_type(t); + switch (bt->kind) { + case Type_Basic: + return bt->Basic.kind == Basic_string; + case Type_Array: + case Type_Slice: + case Type_DynamicArray: + return true; + } + return false; +} + bool is_type_polymorphic_record(Type *t) { t = base_type(t); |