Skip to content

"A.b.C" raises error in autolinker #1285

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

Conversation

maartenvanvliet
Copy link
Contributor

Generating the docs for a https://github.com/aws-beam/aws-elixir/ triggered an error.

I was able to reproduce it in a test with

assert_unchanged("A.b.C")

With the following error:

  1) test doc/3 unknown module (ExDoc.AutolinkTest)
     test/ex_doc/autolink_test.exs:33
     ** (FunctionClauseError) no function clause matching in :elixir_aliases.do_concat/2

     The following arguments were given to :elixir_aliases.do_concat/2:
     
         # 1
         [{{:., [line: 1], [{:__aliases__, [line: 1], [:A]}, :b]}, [no_parens: true, line: 1], []}, :C]
     
         # 2
         "Elixir"
     
     code: assert_unchanged("A.b.C")
     stacktrace:
       (elixir 1.10.1) src/elixir_aliases.erl:120: :elixir_aliases.do_concat/2
       (elixir 1.10.1) src/elixir_aliases.erl:108: :elixir_aliases.concat/1
       (ex_doc 0.22.6) lib/ex_doc/autolink.ex:296: ExDoc.Autolink.do_parse_module/1
       (ex_doc 0.22.6) lib/ex_doc/autolink.ex:216: ExDoc.Autolink.url/3
       (ex_doc 0.22.6) lib/ex_doc/autolink.ex:80: ExDoc.Autolink.walk/2
       test/ex_doc/autolink_test.exs:444: ExDoc.AutolinkTest.assert_unchanged/2
       test/ex_doc/autolink_test.exs:36: (test)

Note that "A.B.C", "A.B.c", "A.b.c" all didnt' raise an error.

@wojtekmach
Copy link
Member

Thank you for the report and the test case, the fix is out in v0.23.0!

@maartenvanvliet maartenvanvliet deleted the issues/invalid_module branch October 12, 2020 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants