aboutsummaryrefslogtreecommitdiff
path: root/src/checker/stmt.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-28 21:25:14 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-28 21:25:14 +0100
commit6e39a42c8a090d6e32231872cc292c90de6b304e (patch)
tree09d9375b92af5caf5cd6a5062e2b1422ab7e461d /src/checker/stmt.cpp
parent5f6b0942f405f5595787ba3436e2e5410268e71e (diff)
Demo 004
Diffstat (limited to 'src/checker/stmt.cpp')
-rw-r--r--src/checker/stmt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/checker/stmt.cpp b/src/checker/stmt.cpp
index 89af771db..c1ca1858b 100644
--- a/src/checker/stmt.cpp
+++ b/src/checker/stmt.cpp
@@ -590,6 +590,11 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
"You cannot apply both `inline` and `no_inline` to a procedure");
}
+ if (is_foreign && is_link_name) {
+ error(ast_node_token(pd->type),
+ "You cannot apply both `foreign` and `link_name` to a procedure");
+ }
+
if (pd->body != NULL) {
if (is_foreign) {
error(ast_node_token(pd->body),
@@ -695,6 +700,7 @@ void check_entity_decl(Checker *c, Entity *e, DeclInfo *d, Type *named_type, Cyc
d = *found;
} else {
e->type = t_invalid;
+ set_base_type(named_type, t_invalid);
return;
// GB_PANIC("`%.*s` should been declared!", LIT(e->token.string));
}