CS2601
error A field cannot be named name.
#What it means
A few names (__proto__, constructor and prototype) cannot be used for fields of a type, because they are reserved inside the engine that runs scripts.
#Typical cause
- A field named after one of these words.
#How to fix it
Rename the field, for example proto or template. See User types, enums and methods.
#Example
//@chartscript 1
indicator("Zones")
type Zone {
top: float
prototype: float
}
const z = Zone.new(high)
plot(z.top)Fixed
//@chartscript 1
indicator("Zones")
type Zone {
top: float
template: float
}
const z = Zone.new(high)
plot(z.top)