aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-12 14:27:13 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-12 14:27:13 -0400
commit46a2aa2ffc71820767f0cdaead84c26dc240c893 (patch)
treeda00733058f5b9b4ef03339d630076880845d9ad /typecheck.c
parent10795782c674df12fc70ea3aeeaa2f62158b6cbd (diff)
Fix up comprehensions so set comprehensions work and everything is a bit
more clean
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/typecheck.c b/typecheck.c
index 192a335b..4952fbd7 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -1250,7 +1250,10 @@ type_t *get_type(env_t *env, ast_t *ast)
case While: case For: return Type(VoidType);
case InlineCCode: {
- type_ast_t *type_ast = Match(ast, InlineCCode)->type;
+ auto inline_code = Match(ast, InlineCCode);
+ if (inline_code->type)
+ return inline_code->type;
+ type_ast_t *type_ast = inline_code->type_ast;
return type_ast ? parse_type_ast(env, type_ast) : Type(VoidType);
}
case Unknown: code_err(ast, "I can't figure out the type of: %W", ast);