cast(Type)expr; Fix overloaded procedure determination on assignment

This commit is contained in:
Ginger Bill
2017-07-11 14:40:27 +01:00
parent 0be0fb2a57
commit c4c6975f1b
8 changed files with 184 additions and 28 deletions
+16 -2
View File
@@ -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;
};