commit 5c77b21fb50b1d9236add4396182da64df09f7dc
parent 967249317d58494257263b054e236c02b66b7ab4
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 30 Apr 2021 09:56:53 -0400
hare::types: refine resolver interface
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hare/types/store.ha b/hare/types/store.ha
@@ -9,7 +9,7 @@ export type resolver = fn(
rstate: *void,
store: *typestore,
expr: const *ast::expr,
-) (size | errors::opaque);
+) (size | deferred | errors::opaque);
export type typestore = struct {
arch: arch,
@@ -19,7 +19,9 @@ export type typestore = struct {
};
// Initializes a new type store. Optionally, provide a function which
-// type-checks and evaluates an [[ast::expr]].
+// type-checks and evaluates an [[ast::expr]]. If a resolver is not provided,
+// looking up types with an expression component (e.g. [2 + 2]int) will return
+// [[noresolver]].
export fn store(
arch: arch,
resolver: nullable *resolver,