Skip to content

Auto unboxing not occurring for boxed primitives in binary operations #397

Open
@BSteffaniak

Description

@BSteffaniak
parseOptionValue(String[] paramNames) -> String => null {
  let index = commands.firstNonNull<Int>((command, i) => {
    if (paramNames.any({ command.equalsIgnoreCase(_) }) && i == commands.count - 1) {
      throw new InvalidCliArgumentException("Invalid #command value")
    }

    if (i > 0 && paramNames.any({ commands[i - 1].equalsIgnoreCase(_) })) {
      return i
    }
  })

  if (index) {
    return this.commands.removeAtIndex(index.value - 1, 2).last
  }
}

return this.commands.removeAtIndex(index.value - 1, 2).last
should be able to be written as
return this.commands.removeAtIndex(index - 1, 2).last

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions