mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-11 15:27:06 -04:00
Record the enum field an implicit selector picks in -export-semantics
This commit is contained in:
1 parent
941cc1c98c
commit
2382daf248
2 files changed
+7
-2
No files matched your search
+6
-1
@@ -10155,7 +10155,12 @@ gb_internal ExprKind check_implicit_selector_expr(CheckerContext *c, Operand *o,
|
||||
o->type = th;
|
||||
|
||||
bool ok = attempt_implicit_selector_expr(c, o, ise, th);
|
||||
if (!ok) {
|
||||
if (ok) {
|
||||
Type *bt = base_type(o->type);
|
||||
if (bt->kind == Type_Enum) {
|
||||
add_entity_use(c, ise->selector, scope_lookup_current(bt->Enum.scope, ise->selector->Ident.interned));
|
||||
}
|
||||
} else {
|
||||
String name = ise->selector->Ident.token.string;
|
||||
|
||||
if (is_type_enum(th)) {
|
||||
|
||||
+1
-1
@@ -2139,7 +2139,7 @@ gb_internal void add_type_and_value(CheckerContext *ctx, Ast *expr, AddressingMo
|
||||
|
||||
gb_internal void add_semantic_ident(CheckerInfo *i, Ast *identifier, Entity *entity, bool definition) {
|
||||
Token const &token = identifier->Ident.token;
|
||||
if (build_context.export_semantics_format != SemanticsFormat_Invalid && (token.flags & TokenFlag_Synthesized) == 0) {
|
||||
if (build_context.export_semantics_format != SemanticsFormat_Invalid && (token.flags & TokenFlag_Synthesized) == 0 && !is_error_muted()) {
|
||||
per_thread_array_add(&i->semantic_ident_queue, SemanticIdent{entity, token.pos.file_id, token.pos.offset, definition});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user