From 2ea075dc4f48b5212a2b404e59ce16147871ba86 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 13 Jun 2010 18:39:26 -0400 Subject: Report error context in expressions more precisely --- src/op.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/op.cc') diff --git a/src/op.cc b/src/op.cc index c2001ec3..d7588b66 100644 --- a/src/op.cc +++ b/src/op.cc @@ -157,7 +157,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth) // Evaluating an identifier is the same as calling its definition // directly, so we create an empty call_scope_t to reflect the scope for // this implicit call. - call_scope_t call_args(scope, scope.type_context(), scope.type_required()); + call_scope_t call_args(scope, locus, depth); result = left()->compile(call_args, depth + 1) ->calc(call_args, locus, depth + 1); check_type_context(scope, result); @@ -168,7 +168,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth) // Evaluating a FUNCTION is the same as calling it directly; this happens // when certain functions-that-look-like-variables (such as "amount") are // resolved. - call_scope_t call_args(scope, scope.type_context(), scope.type_required()); + call_scope_t call_args(scope, locus, depth); result = as_function()(call_args); check_type_context(scope, result); #if defined(DEBUG_ON) @@ -235,7 +235,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth) } case O_CALL: { - call_scope_t call_args(scope, scope.type_context(), scope.type_required()); + call_scope_t call_args(scope, locus, depth); if (has_right()) call_args.set_args(split_cons_expr(right()->kind == O_SEQ ? right()->left() : right())); -- cgit v1.2.3