Skip to content

Conversation

@katafrakt
Copy link
Contributor

@katafrakt katafrakt commented Jan 28, 2026

Using an "any struct match" (I don't know the proper term, sorry) causes errors being logged during indexing:

14:58:09.984 [debug] Node port message: 
14:58:09.984 [error] Could not expand alias: {:_, [line: 1590, column: 35], nil} at /path/to/file.ex 1590:34

The code causing it is, for example:

  defp normalize_suggestion_data(%_{} = struct) do
    Map.from_struct(struct)
  end

This change adds proper handling to this kind of matches (ignoring them, as they are not useful, but without emitting an error).

@katafrakt katafrakt marked this pull request as ready for review January 28, 2026 14:18
Copy link
Collaborator

@doorgan doorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It works
Let's just assert rather than crashing the test in the ones I commented and it's good to merge

@katafrakt katafrakt force-pushed the any-struct-pattern-match branch from 27ea1b0 to 6085028 Compare January 28, 2026 14:34
@doorgan doorgan merged commit 86fe8ec into elixir-lang:main Jan 28, 2026
37 checks passed
@katafrakt katafrakt deleted the any-struct-pattern-match branch January 28, 2026 14:43
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.

2 participants