Skip to content

Expressions starting from _ are treated as placeholders in match cases #1025

@pepkin88

Description

@pepkin88

Example:

match a
| _.isString => 1
| (_.isString) => 1

Result:

var ref$;
switch (ref$ = [a], false) {
case !true:
  1;
  break;
case !_.isString(ref$[0]):
  1;
}

Expected result:

var ref$;
switch (ref$ = [a], false) {
case !_.isString(ref$[0]):
  1;
  break;
case !_.isString(ref$[0]):
  1;
}

The example shows, that wrapping the expression in parentheses is enough to bypass this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions