Obliterate the callee_id hack

Exprs that could be applications of overloaded operators
(expr_unary, expr_binary, expr_index) relied on the previous node ID
being "reserved" to carry extra typechecking info. This was
incredibly error-prone. Fixed it; now all exprs have two node IDs
(which will be wasted in some cases; future work could make this
an option instead if the extra int field ends up being a performance
problem).

Closes #2804
This commit is contained in:
Tim Chevalier
2012-07-11 14:31:35 -07:00
parent fec8059ed5
commit 78ec6fe30c
21 changed files with 148 additions and 57 deletions

View File

@@ -688,6 +688,7 @@ impl of ast_fold for ast_fold_precursor {
fn fold_expr(&&x: @expr) -> @expr {
let (n, s) = self.fold_expr(x.node, x.span, self as ast_fold);
ret @{id: self.new_id(x.id),
callee_id: self.new_id(x.callee_id),
node: n,
span: self.new_span(s)};
}