Skip to content

Passing nameless argument to function requiring an implicit named argument fails #422

Open
@BSteffaniak

Description

@BSteffaniak
public trimEnd(var Int: end = count - 1, Char[] charsToTrim = WHITESPACE) -> String {
  while (end >= 0 && charsToTrim.contains(chars[end])) end--

  return end < 0 ? "" : substring(0, end + 1)
}

public trimEnd(Char charToTrim, var Int: end = count - 1) =>
  trimEnd(end, [charToTrim])

passes [charToTrim] as generated54: [charToTrim]

A workaround is to call the function like this: trimEnd(end, charsToTrim: [charToTrim])

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions