Diagnostics
C002
read-only collection passed to a function that changes it
C002
A function tried to change a frozen collection passed as an argument. Pass mutable state instead, or change the function so it only reads the collection.
Failing example
script "example"
data chart = subscribe(data.ohlcv)
setup xs = [1.0]
fn append(xs: float[]) { xs.push(2.0) }
on chart.update { append(xs) }Corrected example
script "fixed"
data chart = subscribe(data.ohlcv)
state xs: float[] = float[](2)
fn append(xs: float[]) { xs.push(2.0) }
on chart.update { append(xs) }