In the current system, pattern matching on the argument side of function abstraction is treated as a syntax sugar of a case expression.
But this is not sound in some cases. For example:
foo() ->
X = 1,
(fun ({ok, X}) -> X + 1 end)({ok, 5}).
our From_erlang.expr_of_erlang_expr convert this code to:
foo() ->
X = 1,
case {ok, 5} of
{ok, X} -> X + 1
end.
In the current system, pattern matching on the argument side of function abstraction is treated as a syntax sugar of a case expression. But this is not sound in some cases. For example:
our
From_erlang.expr_of_erlang_expr
convert this code to:The two codes have different semantics.
This difference appears when all of the following conditions are satisfied.
Priority
The priority is low because this problem appears in a rare case.
How to resolve this
Ast.Abs
so that function abstraction can have patterns