Skip to content

unless/else changes to if/else but does not flip condition or body #77

@jcowgar

Description

@jcowgar

Versions

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit:ns]

Elixir 1.15.5 (compiled with Erlang/OTP 26)
  locked at 0.9.2 (styler) c3f63885

Example Input

unless true do
  1
else
  2
end

Stacktrace / Current Behaviour

It changes the unless to if but does not flip the bodies. Thus, changing behavior.

It converts the above code block to

if true do
  1
else
  2
end

it should be

if true do
  2
else
  1
end

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