Diagnostic

E3302

A call that keeps a state stands directly in an operand that runs only when it is needed: the right side of `and`, `or` or `??`, or an arm of `if … then … else`.

Kind
ERROR
Raised
While the script is read and checked
Group
Language rules

Message

The message has several forms. The parts in color are filled in with the details of the problem.

{call} keeps a state for this place in the script, and here it stands , which runs only when it is needed, so the state would move on some bars only. To run it on every bar, write it first on a line of its own (let x = …) and use x here; to run it only where it is reached, write the condition as a block ifin the right side of and{and}in the right side of or{or}in the right side of ??{coalesce}in an arm of if … then … else{arm}

Details the message can carry

and, arm, call, coalesce, or

The code is stable; the wording may change. Back to the index.