Skip to content

Switch doesn't work with the ternary operator #329

Description

@rstacruz

This:

switch (if a then b else c)
  when d
    e()

is expected to become:

switch (a ? b : c) {
  case d:
    e();
    break;
}

but instead gives you:

  • Unknown expression type: IfStatement

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4150286-switch-doesn-t-work-with-the-ternary-operator?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions