Lightning talk: Typechecking Elixir
summary
Demo GenServer code uses Gradualizer to treat specs as a contract for accepted messages and to produce a dead-code warning when a handler’s clause is no longer declared, and exhaustiveness checking with an example value for missing variants. Response types are verified by attaching an annotate_type macro or an equivalent external function so case branches and mistyped message tags are caught at check time rather than in CI or tests, and Gradualizer runs much faster than Dialyzer.
AI-written summary · about
chapters (9)
- 0:00Typechecking Elixir
- 1:24Demo setup with Gradualizer
- 2:27Dead code detection
- 3:29Exhaustiveness checking
- 4:31Catching message typos
- 5:38GenServer response checks
- 7:21Exhaustiveness for responses
- 8:23Gradualizer vs Dialyzer
- 9:27Adopting type specs
related talks
36mTypeCheck Effortless Runtime Type Checking
49mDialyzer: Optimistic Type Checking for Erlang and Elixir
06mLightning talk - Parallel static analysis in Elixir
38mChemanalysis: Dialyzing Elixir
29mSame same but different: A Comparative Analysis of Static Type Checkers in Erlang
38mLiving with Spec
04mLT: GraphQL Queries, No Drama: Compile - Time Validation and Formatting
33mLets Generate Tests
