Allow binary operators to be used as lambdas #876

Merged
ghallak merged 7 commits from ghallak/228 into master 2022-06-03 18:12:24 +09:00
Showing only changes of commit 8b2fdd5ab9 - Show all commits

View File

@ -1641,7 +1641,10 @@ infer_expr(Env, {app, Ann, Fun, Args0} = App) ->
GeneralResultType = fresh_uvar(Ann),
ResultType = fresh_uvar(Ann),
when_warning(warn_unused_functions,
fun() -> register_function_call(Namespace ++ qname(CurrentFun), Name) end),
fun() -> if element(1, Name) == lam -> ok;
true -> register_function_call(Namespace ++ qname(CurrentFun), Name)
end
end),
unify(Env, FunType, {fun_t, [], NamedArgsVar, ArgTypes, GeneralResultType}, When),
when_warning(warn_negative_spend, fun() -> warn_potential_negative_spend(Ann, NewFun1, NewArgs) end),
add_constraint(