Skip to content

Commit 368884c

Browse files
committed
Merge branch 'fix-erlang' into john/erts/merge-PR-10038
* fix-erlang: erlang: fix spawn_link
2 parents 0696dd4 + 708dbcb commit 368884c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

erts/preloaded/src/erlang.erl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10456,11 +10456,9 @@ the new process, atomically. Otherwise works like `spawn/3`.
1045610456
""".
1045710457
-doc #{ category => processes }.
1045810458
-spec spawn_link(Fun) -> pid() when
10459-
Fun :: function().
10460-
spawn_link(F) when erlang:is_function(F) ->
10459+
Fun :: fun(() -> term()).
10460+
spawn_link(F) when erlang:is_function(F, 0) ->
1046110461
erlang:spawn_link(erlang, apply, [F, []]);
10462-
spawn_link({M,F}=MF) when erlang:is_atom(M), erlang:is_atom(F) ->
10463-
erlang:spawn_link(erlang, apply, [MF, []]);
1046410462
spawn_link(F) ->
1046510463
badarg_with_info([F]).
1046610464

@@ -10474,13 +10472,11 @@ process. Otherwise works like `spawn/3`.
1047410472
-doc #{ category => processes }.
1047510473
-spec spawn_link(Node, Fun) -> pid() when
1047610474
Node :: node(),
10477-
Fun :: function().
10475+
Fun :: fun(() -> term()).
1047810476
spawn_link(N, F) when N =:= erlang:node() ->
1047910477
spawn_link(F);
10480-
spawn_link(N, F) when erlang:is_function(F) ->
10478+
spawn_link(N, F) when erlang:is_function(F, 0) ->
1048110479
spawn_link(N, erlang, apply, [F, []]);
10482-
spawn_link(N, {M,F}=MF) when erlang:is_atom(M), erlang:is_atom(F) ->
10483-
spawn_link(N, erlang, apply, [MF, []]);
1048410480
spawn_link(N, F) ->
1048510481
badarg_with_info([N, F]).
1048610482

0 commit comments

Comments
 (0)