Skip to content

Commit fc57bdc

Browse files
committed
Remove dead code found by the type system
1 parent 7d20a92 commit fc57bdc

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

lib/ex_doc/language/erlang.ex

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ defmodule ExDoc.Language.Erlang do
7474
callback_data(name, arity, anno, signature, metadata, module_data)
7575

7676
kind == :type ->
77-
type_data(name, arity, anno, signature, metadata, module_data)
77+
type_data(name, arity, signature, metadata, module_data)
7878

7979
true ->
8080
false
@@ -141,15 +141,9 @@ defmodule ExDoc.Language.Erlang do
141141
}
142142
end
143143

144-
defp type_data(name, arity, anno, signature, metadata, module_data) do
145-
{specs, file, line, type} =
146-
case Source.fetch_type!(module_data, name, arity) do
147-
%{attr: attr, source_file: file, source_line: line, type: type} ->
148-
{[attr], file, line, type}
149-
150-
nil ->
151-
{[], nil, Source.anno_line(anno), :type}
152-
end
144+
defp type_data(name, arity, signature, metadata, module_data) do
145+
%{attr: attr, source_file: file, source_line: line, type: type} =
146+
Source.fetch_type!(module_data, name, arity)
153147

154148
%{
155149
id_key: "t:",
@@ -159,7 +153,7 @@ defmodule ExDoc.Language.Erlang do
159153
signature: signature,
160154
source_file: file,
161155
source_line: line,
162-
specs: specs,
156+
specs: [attr],
163157
type: type
164158
}
165159
end

0 commit comments

Comments
 (0)