Skip to content
New issue

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

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

Already on GitHub? # to your account

Support non string labels #39

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Support non string labels #39

merged 1 commit into from
Sep 28, 2024

Conversation

martosaur
Copy link
Contributor

Hi 👋

Non-string labels are passed to inspect result as-is which doesn't work for e.g. atoms:

iex(2)> DG.new() |> tap(& DG.add_vertex(&1, 1, :foo))
#Inspect.Error<
  got FunctionClauseError with message:

      """
      no function clause matching in Inspect.Algebra.concat/2
      """

  while inspecting:

      %{
        opts: [],
        __struct__: DG,
        dg: {:digraph, #Reference<0.220188636.626130951.253424>,
         #Reference<0.220188636.626130951.253425>,
         #Reference<0.220188636.626130951.253426>, true}
      }

  Stacktrace:

    (elixir 1.16.3) lib/inspect/algebra.ex:587: Inspect.Algebra.concat(:foo, "]")
    (elixir 1.16.3) lib/inspect/algebra.ex:946: Inspect.Algebra.fold_doc/2
    (dg 0.4.0) lib/inspect.ex:14: anonymous fn/2 in Inspect.DG.inspect/2
    (elixir 1.16.3) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (dg 0.4.0) lib/inspect.ex:11: Inspect.DG.inspect/2
    (elixir 1.16.3) lib/inspect/algebra.ex:347: Inspect.Algebra.to_doc/2
    (elixir 1.16.3) lib/kernel.ex:2352: Kernel.inspect/2
    (iex 1.16.3) lib/iex/evaluator.ex:376: IEx.Evaluator.io_inspect/1

>

@princemaple princemaple merged commit 4332117 into princemaple:main Sep 28, 2024
11 checks passed
@princemaple
Copy link
Owner

Thanks!

@martosaur martosaur deleted the am/inspectable_labels branch September 28, 2024 03:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants