MMTMMT Docs
Diagnostics

C005

empty array needs an explicit capacity

C005

An empty array literal provides neither elements nor a capacity. Supply an element, a type-and-capacity constructor, or another capacity source.

Failing example

script "conf"

data chart = subscribe(data.ohlcv)

plot out = plot.line(title: "out")

state xs: float[] = []

on chart.update {
  let ys: int[] = []
  out.plot(0.0)
}

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
on chart.update { let values = float[](2) }

On this page