Skip to content

Commit

Permalink
should_fail/intersection_with_any - one more example (josefs#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-klyuchnikov authored Dec 11, 2020
1 parent f327b0b commit df3f352
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions test/known_problems/should_pass/intersection_with_any.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-module(intersection_with_any).

-export([intersection_using_constraints/1]).

%% X :: integer() & any() by the constraints
-spec intersection_using_constraints(X) -> 5 when X :: integer(), X :: any().
intersection_using_constraints(X) ->
% X :: integer() & any() at this point,
% which should be compatible with X :: 5
X.
3 changes: 1 addition & 2 deletions test/should_fail/intersection_with_any.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

-export([intersection_using_constraints/1]).

%% X :: integer() & any() by the constraints
-spec intersection_using_constraints(X) -> 5 when X :: integer(), X :: any().
-spec intersection_using_constraints(X) -> atom() when X :: integer(), X :: any() .
intersection_using_constraints(X) ->
X.

0 comments on commit df3f352

Please sign in to comment.