File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ()).
88return_fun_union () ->
@@ -12,5 +12,10 @@ return_fun_union() ->
1212return_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 () -> [].
1619nil () -> [].
20+
21+ no_spec () -> ok .
Original file line number Diff line number Diff line change @@ -22,17 +22,9 @@ return_fun_intersection() -> fun number/1.
2222 fun ((1 ..3 ) -> integer ()).
2323return_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 () -> [].
3226nil () -> [].
3327
3428-spec number (integer ()) -> integer ();
3529 (float ()) -> float ().
3630number (N ) -> N .
37-
38- no_spec () -> ok .
You can’t perform that action at this time.
0 commit comments