Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to render links for specs when using Elixir 1.17 or later #1925

Closed
garazdawi opened this issue Jun 19, 2024 · 1 comment
Closed

Failure to render links for specs when using Elixir 1.17 or later #1925

garazdawi opened this issue Jun 19, 2024 · 1 comment

Comments

@garazdawi
Copy link
Contributor

The code in ExDoc.Language.Erlang.autolink_spec has started to break for certain modules when ex_doc uses Elixir 1.17 or later.

When building the docs in Erlang/OTP for mnesia I get the error below.

I did a git bisect of elixir to figure out what caused the regression and it is this commit: elixir-lang/elixir@d68c8d6

I'm unsure if the fault is with the change that was introduced in Elixir or if it is how ExDoc uses the type parser...

      warning: internal inconsistency, please submit bug: "atom" != "'...'"
      │
 1035 │ -spec activity(AccessContext, Fun, [Arg::_], Mod) -> t_result(Res) | Res when
      │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      │
      └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:1035: :mnesia.activity/4

      warning: spec references type ".../0" but it is undefined or private
      │
 1035 │ -spec activity(AccessContext, Fun, [Arg::_], Mod) -> t_result(Res) | Res when
      │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      │
      └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:1035: :mnesia.activity/4

     warning: internal inconsistency, please submit bug: "non_neg_integer" != "'...'"
     │
 799 │ -spec sync_transaction(Fun, Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:799: :mnesia.sync_transaction/2

     warning: spec references type ".../0" but it is undefined or private
     │
 799 │ -spec sync_transaction(Fun, Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:799: :mnesia.sync_transaction/2

     warning: internal inconsistency, please submit bug: "t_result" != "non_neg_integer"
     │
 799 │ -spec sync_transaction(Fun, Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:799: :mnesia.sync_transaction/2

     warning: internal inconsistency, please submit bug: "non_neg_integer" != "'...'"
     │
 821 │ -spec sync_transaction(Fun, [Arg::_], Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:821: :mnesia.sync_transaction/3

     warning: spec references type ".../0" but it is undefined or private
     │
 821 │ -spec sync_transaction(Fun, [Arg::_], Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:821: :mnesia.sync_transaction/3

     warning: internal inconsistency, please submit bug: "non_neg_integer" != "'...'"
     │
 786 │ -spec transaction(Fun, [Arg::_], Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:786: :mnesia.transaction/3

     warning: spec references type ".../0" but it is undefined or private
     │
 786 │ -spec transaction(Fun, [Arg::_], Retries) -> t_result(Res) when
     │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ (mnesia 4.23.2) /home/eluklar/git/otp/lib/mnesia/src/mnesia.erl:786: :mnesia.transaction/3

View "html" docs at "html/index.html"
garazdawi added a commit to garazdawi/ex_doc that referenced this issue Jun 20, 2024
@josevalim
Copy link
Member

I am looking into this and I think your fix is correct. Before ... could be written either as {:..., _, nil} a variable or as a call {:..., _, []}. Now it can only be a call and we were not handling it. The bug was there before, we were just not running into it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants