diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-09-13 22:20:27 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-09-13 22:20:27 +0100 |
| commit | 333db4dc94cb1d18c54dda74a7807cea66c131ce (patch) | |
| tree | c993ff98cffe1082f525c7ab7a829cc7c021efaa /src/checker.cpp | |
| parent | cbcf4b6071a55a8e80c41647e81715cf8505bdf8 (diff) | |
Fix issues #95 and #96
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index ed9da4fee..8f4b2f766 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1074,11 +1074,11 @@ bool add_entity(Checker *c, Scope *scope, AstNode *identifier, Entity *entity) { String name = entity->token.string; if (!is_blank_ident(name)) { Entity *ie = scope_insert_entity(scope, entity); - if (ie) { + if (ie != nullptr) { TokenPos pos = ie->token.pos; Entity *up = ie->using_parent; if (up != nullptr) { - if (token_pos_eq(pos, up->token.pos)) { + if (pos == up->token.pos) { // NOTE(bill): Error should have been handled already return false; } @@ -1089,7 +1089,7 @@ bool add_entity(Checker *c, Scope *scope, AstNode *identifier, Entity *entity) { LIT(up->token.pos.file), up->token.pos.line, up->token.pos.column); return false; } else { - if (token_pos_eq(pos, entity->token.pos)) { + if (pos == entity->token.pos) { // NOTE(bill): Error should have been handled already return false; } |