Skip to content

Remove dead autolink_spec(nil, _opts) - #2275

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
praialabs:autolink_spec-deadcode
Oct 12, 2026
Merged

josevalim merged 1 commit into
elixir-lang:mainfrom
praialabs:autolink_spec-deadcode

Conversation

@rhcarvalho

Copy link
Copy Markdown
Contributor

I noticed the dead code while working on #2274.

In f40c272, ExDoc.Language.Erlang introduced typespec(nil, _opts), which violated the callback typespec (@callback typespec(...) :: iodata()). No callers actually passed nil.

In 563f79c, typespec/2 was renamed to autolink_spec/2 and this nil clause was carried over verbatim.

It has been dead code violating the callback contract since its introduction.

In f40c272, `ExDoc.Language.Erlang` introduced `typespec(nil, _opts)`,
which violated the callback typespec (`@callback typespec(...) :: iodata()`).
No callers actually passed `nil`.

In 563f79c, `typespec/2` was renamed to `autolink_spec/2` and this nil
clause was carried over verbatim.

It has been dead code violating the callback contract since its
introduction.

Assisted-by: Antigravity:Gemini 3.8 Flash
@github-actions

Copy link
Copy Markdown

@josevalim
josevalim merged commit 02a89ed into elixir-lang:main Oct 12, 2026
6 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@rhcarvalho
rhcarvalho deleted the autolink_spec-deadcode branch October 12, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants