Skip to content

Single-quoted heredocs gives no deprecation warning in IEX #15090

@AlternateRT

Description

@AlternateRT

Elixir and Erlang/OTP versions

Erlang/OTP 28 [erts-16.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.19.5 (compiled with Erlang/OTP 28)

Operating system

macOS 15.7.3

Current behavior

The heredocs are only re-printed before being evaluated into their ~c sigil representation.

iex(1)> '''
...(1)> elixir
...(1)> '''
iex(1)> '''
        elixir
        '''
~c"elixir\n"

Expected behavior

This should give a deprecation warning message similar to the one you get when you try to use single-quoted strings.

iex(1)> '''
...(1)> elixir
...(1)> '''
warning: using single-quoted heredocs to represent charlists is deprecated.
Use ~c""" if you indeed want a charlist or use """ instead.
You may run "mix format --migrate" to change all single-quoted
heredocs to use the ~c sigil and fix this warning.
└─ iex:1:1
iex(1)> '''
        elixir
        '''
~c"elixir\n"

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