diff --git a/executable_semantics/interpreter/typecheck.cpp b/executable_semantics/interpreter/typecheck.cpp index 43abcd1aa44a..ad89ea9d442c 100644 --- a/executable_semantics/interpreter/typecheck.cpp +++ b/executable_semantics/interpreter/typecheck.cpp @@ -335,9 +335,8 @@ auto TypeCheckExp(Expression* e, TypeEnv* env, Env* ct_env, Value* expected, switch (fun_res.type->tag) { case ValKind::FunctionTV: { auto fun_t = fun_res.type; - auto arg_res = - TypeCheckExp(e->u.call.argument, fun_res.env, ct_env, - fun_t->u.fun_type.param, TCContext::ValueContext); + auto arg_res = TypeCheckExp(e->u.call.argument, fun_res.env, ct_env, + fun_t->u.fun_type.param, context); ExpectType(e->line_num, "call", fun_t->u.fun_type.param, arg_res.type); auto new_e = MakeCall(e->line_num, fun_res.exp, arg_res.exp); diff --git a/executable_semantics/testdata/choice1.golden b/executable_semantics/testdata/choice1.golden index 45d5532882c4..009c5c8dae95 100644 --- a/executable_semantics/testdata/choice1.golden +++ b/executable_semantics/testdata/choice1.golden @@ -56,17 +56,11 @@ alt Two (0 = Int, 1 = Int); --- step exp auto ---> --- step exp auto ---> --- step exp auto ---> -18: compilation error, pattern variables are only allowed in pattern context --- step exp auto ---> -20: compilation error, pattern variables are only allowed in pattern context --- step exp auto ---> -20: compilation error, pattern variables are only allowed in pattern context --- step exp auto ---> -24: compilation error, pattern variables are only allowed in pattern context --- step exp auto ---> -28: compilation error, pattern variables are only allowed in pattern context --- step exp auto ---> -28: compilation error, pattern variables are only allowed in pattern context --- step exp auto ---> ********** type checking complete **********