Skip to content

A certain type definition with multiple any() crashes ex_doc #1974

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

Closed
gomoripeti opened this issue Nov 29, 2024 · 0 comments
Closed

A certain type definition with multiple any() crashes ex_doc #1974

gomoripeti opened this issue Nov 29, 2024 · 0 comments

Comments

@gomoripeti
Copy link

The below type definition causes a crash on main (commit d8146c3)

-type foo() :: fun((...) -> any()) | [any()].

crash:

       (ex_doc 0.35.1) lib/ex_doc/language/erlang.ex:699: ExDoc.Language.Erlang.pop/0
       (ex_doc 0.35.1) lib/ex_doc/language/erlang.ex:617: anonymous fn/2 in ExDoc.Language.Erlang.replace/3
       (elixir 1.14.0) lib/string.ex:1620: String.do_replace/4
       (elixir 1.14.0) lib/string.ex:1623: String.do_replace/4
       (elixir 1.14.0) lib/string.ex:1577: String.replace_guarded/4
       (ex_doc 0.35.1) lib/ex_doc/language/erlang.ex:601: ExDoc.Language.Erlang.autolink_spec/4

I couldn't shrink it further what is special about that contrived type definition, but the below type definitions work fine:

-type foo() :: fun() | [any()].
-type foo() :: fun((...) -> integer()) | [any()].
-type foo() :: fun((...) -> any()) | [integer()].
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

1 participant