Skip to content

Commit

Permalink
fix(check): Don't consider global variables for overload resolution
Browse files Browse the repository at this point in the history
For some reason this was done in rename.rs (they are ignore in the typecheck.rs part).
  • Loading branch information
Marwes committed Nov 6, 2017
1 parent 55ccbe1 commit aeade63
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions check/src/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ pub fn rename(
/// as `id` was currently unique (#Int+, #Float*, etc)
fn rename(&self, id: &Symbol, expected: &ArcType) -> Result<Option<Symbol>, RenameError> {
let locals = self.env.stack.get_all(id);
let global = self.env.env.find_type(id).map(|typ| (id, None, typ));
let candidates = || {
locals
.iter()
Expand All @@ -222,7 +221,6 @@ pub fn rename(
.rev()
.map(|bind| (&bind.0, Some(&bind.1), &bind.2))
})
.chain(global)
};
// If there is a single binding (or no binding in case of primitives such as #Int+)
// there is no need to check for equivalency as typechecker couldnt have infered a
Expand Down

0 comments on commit aeade63

Please sign in to comment.