Ace icon indicating copy to clipboard operation
Ace copied to clipboard

Add and fix some type specs

Open ishikawa opened this issue 5 years ago • 3 comments

Because the Dialyzer had emitted some errors when compiling with this library, so I added/fixed some type specs.

  • Changed Ace.HTTP.Service.service to GenServer.server - GenServer.call/2 can take several type of argument other than pid.
  • Ace.HTTP.Service.start_link/2 actually invoke GenServer.start_link/3, so changed the return type of the function to GenServer.on_start which allows {:error, term} too.
  • Add type specs Ace.HTTP2.Settings.

ishikawa avatar Dec 29 '19 07:12 ishikawa

Running the Dialyzer under Erlang 21.3 and Elixir 1.8.1 environment failed with errors (Job #630850457):

lib/ace/http2/connection.ex:37: Function init/1 has no local return
done (warnings were emitted)
The command "mix dialyzer --halt-exit-status" exited with 2.

I found that this problem could be fixed with upgrading Erlang/OTP to 21.3.8 (Job #631233171). So I changed the version of OTP in travis.yml in the commit ee43e18.

But the Dialyzer still fails under Elixir 1.7.4 environment :thinking:

ishikawa avatar Dec 31 '19 09:12 ishikawa

@ishikawa this might be fixed by dropping support for older Elixir versions. I am thinking of supporting 1.9 and 1.10 only from the next release.

CrowdHailer avatar Apr 01 '20 08:04 CrowdHailer

@CrowdHailer Thanks for your reply. In the meantime, I merged the master branch 😄

ishikawa avatar Apr 27 '20 13:04 ishikawa