MMTMMT Docs
Diagnostics

L005

map key is too long

L005

A string map key exceeds the byte limit. Shorten the key; the limit counts UTF-8 bytes, not characters.

Failing example

script "example"
data chart = subscribe(data.ohlcv)
state values: map<string, int> = map<string, int>(2)
on chart.update { values["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] = 1 }

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
state values: map<string, int> = map<string, int>(2)
on chart.update { values["short"] = 1 }

On this page