title: Erlang: Supervisor start_child succeeds but no child is added
body: <p>I'm working on building a supervisor in Erlang that looks like this:</p>
  <pre><code>-module(a_sup).
  -behaviour(supervisor).
  
  %% API
  -export([start_link/0, init/1]).
  
  start_link() -&gt;
    {ok, supervisor:start_link({local,?MODULE}, ?MODULE, [])}.
  
  init(_Args) -&gt;
    RestartStrategy = {simple_one_for_one, 5, 3600},
    ChildSpec = {
      a_gen_server,
      {a_gen_server, start_link, []},
      permanent,
      brutal_kill,
      worker,
      [a_gen_server]
    },
    {ok, {RestartStrategy,[ChildSpec]}}.
  </code></pre>
  <p>And this is how my gen_server looks:</p>
  <pre><code>-module(a_gen_server).
  -behavior(gen_server).
  
  %% API
  -export([start_link/2, init/1]).
  
  start_link(Name, {X, Y}) -&gt;
    gen_server:start_link({local, Name}, ?MODULE, [Name, {X,Y}], []),
    ok.
  
  init([Name, {X,Y}]) -&gt;
    process_flag(trap_exit, true),
    io:format(&quot;~p: position {~p,~p}~n&quot;,[Name, X, Y]),
    {ok, {X,Y}}.
  </code></pre>
  <p>My gen_server works completely fine. When I run the supervisor as:</p>
  <pre><code>1&gt; c(a_sup).
  {ok,a_sup}
  2&gt; Pid = a_sup:start_link().
  {ok,{ok,&lt;0.85.0&gt;}}
  3&gt; supervisor:start_child(a_sup, [Hello, {4,3}]).
  Hello: position {4,3}
  {error,ok}
  </code></pre>
  <p>I couldn't understand where the <code>{error, ok}</code> is coming from, and if there is an error, then what is causing it. So this is what I get when I check the status of the children:</p>
  <pre><code>&gt; supervisor:count_children(a_sup).
  [{specs,1},{active,0},{supervisors,0},{workers,0}]
  </code></pre>
  <p>This means that there are no children registered with the supervisor yet despite it calling the init method of the gen_server and spawning a process? Clearly there is some error preventing the method to complete successfully but I can't seem to gather any hints to figure it out.</p>