thqby/vscode-autohotkey2-lsp

Ternary warning inside class

Closed this issue · 3 comments

Happens if a ternary is inside a class method and contains a this property assignment.
image

Maybe it is a bug of AHK rather than the extension.
image
In the above picture, the , operator has lower precedence than ?:. So it will throw.
Therefore, a := between ?: without parentheses should throw too.

Maybe it is a bug of AHK rather than the extension.

Your code example is flawed. You've included a multi-statement inside your ternary without putting it in parentheses.

(1) ? (2, (this.xx:=32)) : 0

Maybe it is a bug of AHK rather than the extension.

Your code example is flawed. You've included a multi-statement inside your ternary without putting it in parentheses.

(1) ? (2, (this.xx:=32)) : 0

Yes. And the same is to this.b:=1.
But I already know what I mistook.😀
image