aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-18 16:31:34 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-18 16:31:34 -0400
commit1df26851d73e50407a3b7c79bcdb5b0cc053fe67 (patch)
treec2e3c393b30ab34d782fd6839100c6854abd7e91 /typecheck.c
parente439fcd1e2090ff797b46c80c6264f08ea9e9cfb (diff)
Add syntax for "inline C(...)"
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 d60a84ea..34d62aad 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -986,7 +986,10 @@ type_t *get_type(env_t *env, ast_t *ast)
}
case While: case For: return Type(VoidType);
- case InlineCCode: return Type(VoidType);
+ case InlineCCode: {
+ type_ast_t *type_ast = Match(ast, InlineCCode)->type;
+ 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);
}
code_err(ast, "I can't figure out the type of: %W", ast);