OpenRA/vscode-openra-lua

Cannot assign `number` to `cpos`.

Mailaender opened this issue · 4 comments

Should be noted that the issue here is that apparently the language server can't tell what the type of ExtractionPath[2] is and does unknown + cvec -> number. Replacing ExtractionPath[2] with something that is explicitly cpos fixes the warning because as of #7 we support the following operations:

---@operator add(cvec): cpos
---@operator sub(cvec): cpos
---@operator add(wvec): wpos
---@operator sub(wvec): wpos

Confirmed that

image

fixes it. However it knows about the types

image

so this is an upstream limitation.

Yeah, that sucks ☹️

Fixed those manually in OpenRA/OpenRA#20698.