@@ -286,11 +286,14 @@ defmodule ExDoc.Retriever.ErlangTest do
286286
287287 -doc("opaque1/0 docs.").
288288 -opaque opaque1() :: atom().
289+
290+ -doc("nominal1/0 docs.").
291+ -nominal nominal1() :: atom().
289292 """ )
290293
291294 config = % ExDoc.Config { source_url_pattern: "%{path}:%{line}" }
292295 { [ mod ] , [ ] } = Retriever . docs_from_modules ( [ :mod ] , config )
293- [ equiv_type1 , opaque1 , type1 ] = mod . typespecs
296+ [ equiv_type1 , opaque1 , nominal1 , type1 ] = mod . typespecs
294297
295298 assert opaque1 . id == "t:opaque1/0"
296299 assert opaque1 . type == :opaque
@@ -301,6 +304,15 @@ defmodule ExDoc.Retriever.ErlangTest do
301304 assert opaque1 . spec |> Erlang . autolink_spec ( current_kfa: { :type , :opaque1 , 0 } ) ==
302305 "opaque1()"
303306
307+ assert nominal1 . id == "t:nominal1/0"
308+ assert nominal1 . type == :nominal
309+ assert nominal1 . group == :Types
310+ assert nominal1 . signature == "nominal1()"
311+ assert nominal1 . doc |> DocAST . to_string ( ) =~ "nominal1/0 docs."
312+
313+ assert nominal1 . spec |> Erlang . autolink_spec ( current_kfa: { :type , :nominal1 , 0 } ) ==
314+ "nominal1() :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:atom/0\" >atom</a>()."
315+
304316 assert type1 . id == "t:type1/0"
305317 assert type1 . type == :type
306318 assert type1 . group == :Types
@@ -484,6 +496,9 @@ defmodule ExDoc.Retriever.ErlangTest do
484496
485497 -opaque opaque1() :: atom().
486498 %% opaque1/0 docs.
499+
500+ -nominal nominal1() :: atom().
501+ %% -doc("nominal1/0 docs.").
487502 """ )
488503
489504 config = % ExDoc.Config { source_url_pattern: "%{path}:%{line}" }
@@ -498,6 +513,15 @@ defmodule ExDoc.Retriever.ErlangTest do
498513 assert opaque1 . spec |> Erlang . autolink_spec ( current_kfa: { :type , :opaque1 , 0 } ) ==
499514 "opaque1()"
500515
516+ assert nominal1 . id == "t:nominal1/0"
517+ assert nominal1 . type == :nominal
518+ assert nominal1 . group == :Types
519+ assert nominal1 . signature == "nominal1/0"
520+ assert nominal1 . doc |> DocAST . to_string ( ) =~ "nominal1/0 docs."
521+
522+ assert nominal1 . spec |> Erlang . autolink_spec ( current_kfa: { :type , :nominal1 , 0 } ) ==
523+ "nominal1() :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:atom/0\" >atom</a>()."
524+
501525 assert type1 . id == "t:type1/0"
502526 assert type1 . type == :type
503527 assert type1 . signature == "type1/0"
0 commit comments