diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-11 14:40:27 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-11 14:40:27 +0100 |
| commit | c4c6975f1b36eb4848aacf81c7be3584c51f9ab6 (patch) | |
| tree | a73b5401f45e8ffb47ebc3fe64281d7080ab7195 /src/checker.cpp | |
| parent | 0be0fb2a57e997d4e7efd7b42f7fe1a1b35c80e5 (diff) | |
`cast(Type)expr`; Fix overloaded procedure determination on assignment
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index e47ad9aa2..e2133144f 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -250,6 +250,18 @@ void scope_reset(Scope *scope) { array_clear(&scope->imported); } +i32 is_scope_an_ancestor(Scope *parent, Scope *child) { + isize i = 0; + while (child != nullptr) { + if (parent == child) { + return true; + } + child = child->parent; + i++; + } + return -1; +} + struct DelayedDecl { Scope * parent; @@ -269,12 +281,14 @@ struct CheckerContext { DeclInfo * decl; u32 stmt_state_flags; bool in_defer; // TODO(bill): Actually handle correctly - bool allow_polymorphic_types; - bool no_polymorphic_errors; String proc_name; Type * type_hint; DeclInfo * curr_proc_decl; AstNode * curr_foreign_library; + + bool allow_polymorphic_types; + bool no_polymorphic_errors; + Scope * polymorphic_scope; }; |