Skip to content

Incorrect expansion of <<?a>> <> rest #1522

@alco

Description

@alco
Macro.to_string Macro.expand_all quote(do: <<?a>> <> rest = "abc"), __ENV__
"<<<<97>> :: binary, rest :: binary>> = \"abc\""

This is an invalid pattern. I was expecting it to produce either

<< <<97>>, rest :: binary>> = "abc"

or

<< 97, rest :: binary>> = "abc"

both of which match.

Compare to this

Macro.to_string Macro.expand_all quote(do: "a" <> rest = "abc"), __ENV__
"<<\"a\", rest :: binary>> = \"abc\""

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions