Skip to content

Commit

Permalink
Add expected failure description to test/known_problems/should_fail/t…
Browse files Browse the repository at this point in the history
…uple_union_arg.erl
  • Loading branch information
erszcz committed Feb 10, 2023
1 parent f9ef467 commit bf32ae0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/known_problems/should_fail/tuple_union_arg.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
(d, e) -> {d, e}.
i(V, U) -> {V, U}.

%% This passes, though it shouldn't, because V is inferred to be d | a,
%% and U is inferred to be b | e.
%% If that was the case, then the call to i/2 could sometimes succeed.
%% Not always, though! So it should already be considered an error.
%%
%% However, due to how the union is structured we know that when V=d, then U=b,
%% and that combination is certain to fail. The same holds for V=a, U=e.
-spec j({d, b} | {a, e}) -> {a, b} | {d, e}.
j({V, U}) -> i(V, U).

0 comments on commit bf32ae0

Please sign in to comment.