Skip to content

Macro.quoted_literal? returns false for __block__ wrapped literals #15830

Description

@yastanotheruser

Existing issue

  • I have searched existing issues and could not find a duplicate.

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.2.7.12] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Elixir 1.20.0-dev (f175f5f) (compiled with Erlang/OTP 27)

Operating system

Alpine Linux

Current behavior

Hello there! I'm using Elixir code formatting, so I checked the implementation of Code.format_string!/1, and it wraps all literals in __block__. Besides formatting, I'm sorting map keys with an AST traversal, and using Macro.quoted_literal?/1 to split computed and literal keys, but it's returning false for the wrapped literals. Is this the expected behavior?

Expected behavior

Should Macro.quoted_literal?/1 return true for literals wrapped in __block__?

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