Skip to content

No warning generated for deprecated ~~~ operator #14869

@lukaszsamson

Description

@lukaszsamson

Elixir and Erlang/OTP versions

1.19.1

Operating system

any

Current behavior

:elixir_tokenizer.tokenize(~c"~~~1", 1, 1, [])
{:ok, 1, 5, [], [{:int, {1, 4, 1}, ~c"1"}, {:unary_op, {1, 1, nil}, :"~~~"}],
 []}

Compare with:

iex(11)> :elixir_tokenizer.tokenize(~c"^^^1", 1, 1, [])
{:ok, 1, 5,
 [
   {{1, 1},
    ~c"^^^ is deprecated. It is typically used as xor but it has the wrong precedence, use Bitwise.bxor/2 instead"}
 ], [{:int, {1, 4, 1}, ~c"1"}, {:xor_op, {1, 1, nil}, :"^^^"}], []}

The code in

looks invalid. ~~~ is a unary_op3 and is not handled by handle_op

Expected behavior

Warning generated

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