Skip to content

Commit b49d297

Browse files
committed
Fix test/should_pass/return_fun.erl
1 parent 764a2a5 commit b49d297

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-module(return_fun_fail).
22

33
-export([return_fun_union/0,
4-
return_fun_remote/0
5-
]).
4+
return_fun_remote/0,
5+
return_fun_no_spec/0]).
66

77
-spec return_fun_union() -> integer() | fun(() -> atom()).
88
return_fun_union() ->
@@ -12,5 +12,10 @@ return_fun_union() ->
1212
return_fun_remote() ->
1313
fun erlang:atom_to_list/1.
1414

15+
-spec return_fun_no_spec() -> integer().
16+
return_fun_no_spec() -> fun no_spec/0.
17+
1518
-spec nil() -> [].
1619
nil() -> [].
20+
21+
no_spec() -> ok.

test/should_pass/return_fun.erl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,9 @@ return_fun_intersection() -> fun number/1.
2222
fun((1..3) -> integer()).
2323
return_fun_union_intersection() -> fun number/1.
2424

25-
%% By default inferring type from expressions with no spec is disabled.
26-
%% So the type of `fun no_spec/0' is `any()' which is a subtype of
27-
%% `integer()'.
28-
-spec return_fun_no_spec() -> integer().
29-
return_fun_no_spec() -> fun no_spec/0.
30-
3125
-spec nil() -> [].
3226
nil() -> [].
3327

3428
-spec number(integer()) -> integer();
3529
(float()) -> float().
3630
number(N) -> N.
37-
38-
no_spec() -> ok.

0 commit comments

Comments
 (0)