intrinsics.type_* constant evaluation procedures

This commit is contained in:
gingerBill
2019-08-04 11:02:00 +01:00
parent 5877017d30
commit 37633c1d2a
5 changed files with 739 additions and 220 deletions

View File

@@ -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);