@@ -286,11 +286,14 @@ defmodule ExDoc.Retriever.ErlangTest do
286
286
287
287
-doc("opaque1/0 docs.").
288
288
-opaque opaque1() :: atom().
289
+
290
+ -doc("nominal1/0 docs.").
291
+ -nominal nominal1() :: atom().
289
292
""" )
290
293
291
294
config = % ExDoc.Config { source_url_pattern: "%{path}:%{line}" }
292
295
{ [ mod ] , [ ] } = Retriever . docs_from_modules ( [ :mod ] , config )
293
- [ equiv_type1 , opaque1 , type1 ] = mod . typespecs
296
+ [ equiv_type1 , opaque1 , nominal1 , type1 ] = mod . typespecs
294
297
295
298
assert opaque1 . id == "t:opaque1/0"
296
299
assert opaque1 . type == :opaque
@@ -301,6 +304,15 @@ defmodule ExDoc.Retriever.ErlangTest do
301
304
assert opaque1 . spec |> Erlang . autolink_spec ( current_kfa: { :type , :opaque1 , 0 } ) ==
302
305
"opaque1()"
303
306
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
+
304
316
assert type1 . id == "t:type1/0"
305
317
assert type1 . type == :type
306
318
assert type1 . group == :Types
@@ -484,6 +496,9 @@ defmodule ExDoc.Retriever.ErlangTest do
484
496
485
497
-opaque opaque1() :: atom().
486
498
%% opaque1/0 docs.
499
+
500
+ -nominal nominal1() :: atom().
501
+ %% -doc("nominal1/0 docs.").
487
502
""" )
488
503
489
504
config = % ExDoc.Config { source_url_pattern: "%{path}:%{line}" }
@@ -498,6 +513,15 @@ defmodule ExDoc.Retriever.ErlangTest do
498
513
assert opaque1 . spec |> Erlang . autolink_spec ( current_kfa: { :type , :opaque1 , 0 } ) ==
499
514
"opaque1()"
500
515
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
+
501
525
assert type1 . id == "t:type1/0"
502
526
assert type1 . type == :type
503
527
assert type1 . signature == "type1/0"
0 commit comments