aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-08 14:33:54 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-08 14:33:54 -0500
commit8427037bb91638b57f0f805cdf1581402cb0f335 (patch)
tree4ef8085974649efd4c0f8a430c2467a0be01e496 /typecheck.c
parent55eacb8a045fe6ae0f048fe3b4247098a49da2b9 (diff)
Refactor table methods to take table structs where possible
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/typecheck.c b/typecheck.c
index 59befcdb..10f2f1d4 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -19,7 +19,7 @@ type_t *parse_type_ast(env_t *env, type_ast_t *ast)
switch (ast->tag) {
case VarTypeAST: {
const char *name = Match(ast, VarTypeAST)->name;
- type_t *t = Table_str_get(env->types, name);
+ type_t *t = Table_str_get(*env->types, name);
if (t) return t;
code_err(ast, "I don't know a type with the name '%s'", name);
}
@@ -340,9 +340,9 @@ type_t *get_type(env_t *env, ast_t *ast)
type_t *fielded_t = get_type(env, access->fielded);
if (fielded_t->tag == TypeInfoType) {
auto info = Match(fielded_t, TypeInfoType);
- table_t *namespace = Table_str_get(env->type_namespaces, info->name);
+ table_t *namespace = Table_str_get(*env->type_namespaces, info->name);
if (!namespace) code_err(access->fielded, "I couldn't find a namespace for this type");
- binding_t *b = Table_str_get(namespace, access->field);
+ binding_t *b = Table_str_get(*namespace, access->field);
if (!b) code_err(ast, "I couldn't find the field '%s' on this type", access->field);
return b->type;
}