Handle index expressions' callee IDs correctly

Some code that handles unary and binary exprs' callee IDs was
    forgetting to handle the index expr case (since calls to
    user-defined index operators also have callee IDs). This was
    manifesting as an ICE in trans because when monomorphizing a
    function that had one of these operators in it (an index into a
    dvec, in the test case), the callee ID would be unbound to a type.

    Fixed it. Closes #2631.
This commit is contained in:
Tim Chevalier
2012-06-15 14:55:03 -07:00
parent 7a253eabce
commit 093faaabe1
4 changed files with 5 additions and 5 deletions

View File

@@ -455,7 +455,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
visit_expr: fn@(e: @expr) {
vfn(e.id);
alt e.node {
expr_unary(_, _) | expr_binary(_, _, _) {
expr_unary(*) | expr_binary(*) | expr_index(*) {
vfn(ast_util::op_expr_callee_id(e));
}
_ { /* fallthrough */ }