diff options
| author | 2022-08-17 05:18:22 +0200 | |
|---|---|---|
| committer | 2022-08-17 05:18:22 +0200 | |
| commit | c50a02ec703c7c1c5f6823c8cbd07a424d604792 (patch) | |
| tree | ef80066da26b0b91c73fba6c6e3234ddc78d869c /src/type.cff | |
| parent | 1ca77f60626666fba792db407dd11ea9b597d9cf (diff) | |
more exprs, warnings
Diffstat (limited to 'src/type.cff')
| -rw-r--r-- | src/type.cff | 12 |
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 = {}, |