aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-13 21:00:42 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-13 21:00:42 +0100
commitc3b510c2d9adf1a9281285fc711a28187288af75 (patch)
tree10c63d92cb2e014135f42bf9066907653ab395b3 /src/check_decl.cpp
parente7fc24e48c39f1aa9f886d13608ad8e22f167027 (diff)
C-style `c_vararg`s (Not heavily tested)
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 60da85d0e..4dff7a838 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -293,13 +293,16 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
}
if (is_foreign && is_export) {
- error_node(pd->type, "You cannot apply both `foreign` and `export` to a procedure");
+ error_node(pd->type, "A foreign procedure cannot have an `export` tag");
}
if (pd->body != NULL) {
if (is_foreign) {
- error_node(pd->body, "A procedure tagged as `foreign` cannot have a body");
+ error_node(pd->body, "A foreign procedure cannot have a body");
+ }
+ if (proc_type->Proc.c_vararg) {
+ error_node(pd->body, "A procedure with a `#c_vararg` field cannot have a body");
}
d->scope = c->context.scope;
@@ -360,7 +363,7 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
Type *other_type = base_type(f->type);
if (!are_signatures_similar_enough(this_type, other_type)) {
error_node(d->proc_decl,
- "Redeclaration of #foreign procedure `%.*s` with different type signatures\n"
+ "Redeclaration of foreign procedure `%.*s` with different type signatures\n"
"\tat %.*s(%td:%td)",
LIT(name), LIT(pos.file), pos.line, pos.column);
}