diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-01-23 01:38:15 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-01-23 01:38:15 +0100 |
| commit | 01e29bf27ef0204f586b856363f7a3bf5138052d (patch) | |
| tree | e2806fec63a858c58e0cc9ea3f6a76666ad90ccc /src/checker.cpp | |
| parent | 96d7c4ffdf91a35d0791234b76be8601a1ced5d7 (diff) | |
| parent | 63771bc6e821b7cca0073684cc03dc74eaef6a13 (diff) | |
Merge remote-tracking branch 'upstream/master' into parser-fix
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index ddb73d33e..63a697072 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1253,7 +1253,7 @@ isize type_info_index(CheckerInfo *info, Type *type, bool error_on_failure) { // TODO(bill): This is O(n) and can be very slow for_array(i, info->type_info_map.entries){ auto *e = &info->type_info_map.entries[i]; - if (are_types_identical(e->key, type)) { + if (are_types_identical_unique_tuples(e->key, type)) { entry_index = e->value; // NOTE(bill): Add it to the search map map_set(&info->type_info_map, type, entry_index); @@ -1601,7 +1601,7 @@ void add_type_info_type_internal(CheckerContext *c, Type *t) { isize ti_index = -1; for_array(i, c->info->type_info_map.entries) { auto *e = &c->info->type_info_map.entries[i]; - if (are_types_identical(t, e->key)) { + if (are_types_identical_unique_tuples(t, e->key)) { // Duplicate entry ti_index = e->value; prev = true; @@ -3446,6 +3446,13 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) { } } + if (entity_visibility_kind == EntityVisiblity_Public && + (c->scope->flags&ScopeFlag_File) && + c->scope->file && + (c->scope->file->flags & AstFile_IsPrivate)) { + entity_visibility_kind = EntityVisiblity_PrivateToPackage; + } + if (entity_visibility_kind != EntityVisiblity_Public && !(c->scope->flags&ScopeFlag_File)) { error(decl, "Attribute 'private' is not allowed on a non file scope entity"); } |