diff options
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index c22ad1645..fd5f8e1e8 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -3469,6 +3469,8 @@ gb_internal void check_decl_attributes(CheckerContext *c, Array<Ast *> const &at StringSet set = {}; defer (string_set_destroy(&set)); + bool is_runtime = ((c->scope->parent->flags&(ScopeFlag_File|ScopeFlag_Pkg)) != 0 && c->scope->file->pkg->kind == Package_Runtime); + for_array(i, attributes) { Ast *attr = attributes[i]; if (attr->kind != Ast_Attribute) continue; @@ -3504,6 +3506,10 @@ gb_internal void check_decl_attributes(CheckerContext *c, Array<Ast *> const &at continue; } + if (name == "builtin" && is_runtime) { + continue; + } + if (!proc(c, elem, name, value, ac)) { if (!build_context.ignore_unknown_attributes) { error(elem, "Unknown attribute element name '%.*s'", LIT(name)); @@ -3663,9 +3669,9 @@ gb_internal void check_builtin_attributes(CheckerContext *ctx, Entity *e, Array< error(value, "'builtin' cannot have a field value"); } // Remove the builtin tag - attr->Attribute.elems[k] = attr->Attribute.elems[attr->Attribute.elems.count-1]; - attr->Attribute.elems.count -= 1; - k--; + // attr->Attribute.elems[k] = attr->Attribute.elems[attr->Attribute.elems.count-1]; + // attr->Attribute.elems.count -= 1; + // k--; mutex_unlock(&ctx->info->builtin_mutex); } |