Skip to content

Commit e161c19

Browse files
committed
Fix for missing nominal case in autolink_spec
Small fix for missing nominal case in autolink_spec.
1 parent ef99f3e commit e161c19

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/ex_doc/language/erlang.ex

+4
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ defmodule ExDoc.Language.Erlang do
236236
{:attribute, anno, :type, ast} ->
237237
{name, _, _} = ast
238238
{name, anno, Code.Typespec.type_to_quoted(ast)}
239+
240+
{:attribute, anno, :nominal, ast} ->
241+
{name, _, _} = ast
242+
{name, anno, Code.Typespec.type_to_quoted(ast)}
239243
end
240244

241245
formatted = format_spec(ast)

test/ex_doc/language/erlang_test.exs

+7
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,13 @@ defmodule ExDoc.Language.ErlangTest do
575575
~s|<a href="https://www.erlang.org/doc/apps/stdlib/array.html#t:array/0"><code class="inline">array:array/0</code></a>|
576576
end
577577

578+
if System.otp_release() >= "28" do
579+
test "OTP nominal", c do
580+
assert autolink_extra("`t:erl_anno:location/0`", c) ==
581+
~s|<a href="https://www.erlang.org/doc/apps/stdlib/erl_anno.html#t:location/0"><code class="inline">erl_anno:location/0</code></a>|
582+
end
583+
end
584+
578585
test "module", c do
579586
assert autolink_extra("`m:erlang_bar`", c) ==
580587
~s|<a href="erlang_bar.html"><code class="inline">erlang_bar</code></a>|

0 commit comments

Comments
 (0)