aboutsummaryrefslogtreecommitdiff
path: root/src/type.cff
diff options
context:
space:
mode:
Diffstat (limited to 'src/type.cff')
-rw-r--r--src/type.cff12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/type.cff b/src/type.cff
index 133246d..a4a4e3d 100644
--- a/src/type.cff
+++ b/src/type.cff
@@ -89,6 +89,18 @@ extern fn interntype(ty0 Type) *const Type {
return *set->intern(&ty0);
}
+extern fn completetype(ty *const Type) bool {
+ if ty.konst {
+ return completetype(unconstify(ty));
+ }
+ switch ty.u {
+ case Void; return #f;
+ case Fn; return #f;
+ case Arr a; return a.length >= 0;
+ }
+ return #t;
+}
+
extern static ty_void *const Type = {},
ty_bool *const Type = {},
ty_i8 *const Type = {},