MMTMMT Docs
Diagnostics

T434

duplicate method or method/field name collision in a type

T434

A type declares two members with the same name, either two methods or a method sharing a field's name; the first declaration is labeled. Rename one of the members.

Failing example

script "conf"
type Zone {
  width: float
  fn width() -> float { return self.width }
}
data chart = subscribe(data.ohlcv)
on chart.update {
  let zone = Zone { width: 1.0 }
}

Corrected example

script "fixed"
type Zone {
  width: float
  fn doubled() -> float { return self.width * 2.0 }
}
data chart = subscribe(data.ohlcv)
on chart.update {
  let zone = Zone { width: 1.0 }
  let doubled = zone.doubled()
}

On this page