diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f98009e7a..a63d199f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,9 +81,11 @@ jobs: # Test Erlang without -doc attribute support - elixir: "1.16" otp: "26" - # Test Erlang with -doc attribute support + # Test with initial Erlang doc attribute support - elixir: "1.17" otp: "27" + - elixir: "1.18" + otp: "27" lint: true steps: - uses: actions/checkout@v3 diff --git a/lib/ex_doc/language/elixir.ex b/lib/ex_doc/language/elixir.ex index 2600849cc..636cfa1a4 100644 --- a/lib/ex_doc/language/elixir.ex +++ b/lib/ex_doc/language/elixir.ex @@ -289,7 +289,7 @@ defmodule ExDoc.Language.Elixir do {:local, :..} ["//", "", ""] -> - {:local, :"..//"} + {:local, :..//} ["", ""] -> {:local, :.} diff --git a/lib/ex_doc/language/erlang.ex b/lib/ex_doc/language/erlang.ex index 5ed3ded85..13cb21800 100644 --- a/lib/ex_doc/language/erlang.ex +++ b/lib/ex_doc/language/erlang.ex @@ -571,7 +571,7 @@ defmodule ExDoc.Language.Erlang do name == :record and acc != [] -> {ast, acc} - name in [:"::", :when, :%{}, :{}, :|, :->, :...] -> + name in [:"::", :when, :%{}, :{}, :|, :->, :..., :fun] -> {ast, acc} # %{required(...) => ..., optional(...) => ...} diff --git a/test/ex_doc/language/erlang_test.exs b/test/ex_doc/language/erlang_test.exs index 9c5ffcd8a..b3f95396f 100644 --- a/test/ex_doc/language/erlang_test.exs +++ b/test/ex_doc/language/erlang_test.exs @@ -814,6 +814,14 @@ defmodule ExDoc.Language.ErlangTest do end end + test "function - specific arity", c do + assert autolink_spec(~s"-spec foo() -> fun((t()) -> t()) | erlang_bar:t().", c) == + ~s[foo() -> fun((t()) -> t()) | erlang_bar:t().] + + assert autolink_spec(~s"-spec foo() -> fun((t(), t()) -> t()) | erlang_bar:t().", c) == + ~s[foo() -> fun((t(), t()) -> t()) | erlang_bar:t().] + end + test "local type", c do assert autolink_spec(~S"-spec foo() -> t().", c) == ~s|foo() -> t().|