Skip to content

Misleading warning when matching tuple/map inside list #15040

@josevalim

Description

@josevalim

Elixir and Erlang/OTP versions

Elixir v1.20-rc

Operating system

All

Current behavior

This test currently fails:

    test "accepts a subtype" do
      # This is a regression that happens because stacktrace may be
      # either three-element or four-element tuples, and it was failing
      # when we tried to access the fourth element
      assert typecheck!(
               try do
                 raise "oops"
               rescue
                 _ ->
                   [{__MODULE__, fun, arity, info} | _] = __STACKTRACE__
                   {fun, arity, length(info)}
               end
             ) == tuple([atom(), integer(), integer()])
    end

Expected behavior

In order to fix this we need to track the first element of the list within the `descr .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions