FlatLang / Flat

(Deprecated) Soon-to-be legacy Flat compiler all in one
6 stars 0 forks source link

Method call with clean argument name fails as ambiguous #403

Closed BSteffaniak closed 2 years ago

BSteffaniak commented 2 years ago
class CliArg {
  public construct(
    String name,
    String[] aliases = new Array<String>(),
    Int: count = 0
  ) {
    this(
      name,
      aliases,
      minCount: count,
      maxCount: count
    )
  }

  public construct(
    String name,
    Int: minCount,
    Int: maxCount = -1
  ) {
    this(
      name,
      new Array<String>(),
      minCount: minCount,
      maxCount: maxCount
    )
  }

  public construct(
    visible String name,
    visible String[] aliases,
    visible Int: minCount,
    visible Int: maxCount = -1
  ) {

  }
}

This fails as ambiguous visible CliArg uninstallCommand = new CliArg("uninstall", minCount: 1)

BSteffaniak commented 2 years ago

Relevant commit: 82583f0f0496be3348151316463b4df37beb703d