diff options
| author | gingerBill <bill@gingerbill.org> | 2022-02-04 22:40:15 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-02-04 22:40:15 +0000 |
| commit | 3a81f2ab898d537bba51b9ea81e047652112574e (patch) | |
| tree | 28d6f4c235c55b6a2f22ba5642a0e88dba3e9c55 /src/check_expr.cpp | |
| parent | abb26e0bead7f33f3335325b0674a9995fdbcd36 (diff) | |
Correct the type aliasing problem, caused by aliases (of aliases)+
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 88296611b..e1c9bde84 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -4088,7 +4088,7 @@ Entity *check_entity_from_ident_or_selector(CheckerContext *c, Ast *node) { return scope_lookup(c->scope, name); } else if (node->kind == Ast_SelectorExpr) { ast_node(se, SelectorExpr, node); - if (!c->allow_arrow_right_selector_expr && se->token.kind == Token_ArrowRight) { + if (se->token.kind == Token_ArrowRight) { return nullptr; } @@ -4108,6 +4108,9 @@ Entity *check_entity_from_ident_or_selector(CheckerContext *c, Ast *node) { if (op_expr->kind == Ast_Ident) { String op_name = op_expr->Ident.token.string; Entity *e = scope_lookup(c->scope, op_name); + if (e == nullptr) { + return nullptr; + } add_entity_use(c, op_expr, e); expr_entity = e; |