Skip to content

Crash in Macro.to_string #13895

@lukaszsamson

Description

@lukaszsamson

Elixir and Erlang/OTP versions

1.17.3, 1.15.7

Operating system

any

Current behavior

I noticed this crash report

    ** (MatchError) no match of right hand side value: {:__block__, [line: 19], ["foo"]}
        (elixir 1.17.3) <REDACTED: user-file-path>:1333: Code.Formatter.interpolation_to_algebra_5
        (elixir 1.17.3) <REDACTED: user-file-path>:504: Code.Formatter.quoted_to_algebra_3
        (elixir 1.17.3) <REDACTED: user-file-path>:589: anonymous fn_3 in Code.Formatter.block_args_to_algebra_4
        (elixir 1.17.3) <REDACTED: user-file-path>:2015: Code.Formatter.each_quoted_to_algebra_without_comments_4
        (elixir 1.17.3) <REDACTED: user-file-path>:2001: Code.Formatter.quoted_to_algebra_with_comments_6
        (elixir 1.17.3) <REDACTED: user-file-path>:594: Code.Formatter.block_args_to_algebra_4
        (elixir 1.17.3) <REDACTED: user-file-path>:159: Code.Formatter.to_algebra_2
        (elixir 1.17.3) <REDACTED: user-file-path>:1136: Macro.to_string_1

and something older

    ** (FunctionClauseError) no function clause matching in anonymous fn_1 in Code.Normalizer.normalize_kw_blocks_4
        (elixir 1.15.7) <REDACTED: user-file-path>:453: anonymous fn({:__cursor__, [closing: [line: 23, column: 160], line: 23, column: 149], []}) in Code.Normalizer.normalize_kw_blocks_4
        (elixir 1.15.7) <REDACTED: user-file-path>:1693: Enum."-map_2-lists^map_1-1-"_2
        (elixir 1.15.7) <REDACTED: user-file-path>:1693: Enum."-map_2-lists^map_1-1-"_2
        (elixir 1.15.7) <REDACTED: user-file-path>:453: Code.Normalizer.normalize_kw_blocks_4
        (elixir 1.15.7) <REDACTED: user-file-path>:1359: Code.quoted_to_algebra_2
        (elixir 1.15.7) <REDACTED: user-file-path>:1186: Macro.to_string_1

No idea what AST triggered it

Expected behavior

No crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions