Hi Baertram, all,
Not sure if I'm being dumb, but...
The immensely useful
JetBrains IntelliJ IDEA autocompletion files have return annotations like this one:
Code:
--- @return gameTimeInSeconds number
function GetGameTimeSeconds() end
...whereas the EmmyLua docs (and the linting that I'm seeing in VSCode) expects:
Code:
---@return MY_TYPE[|OTHER_TYPE] [@comment]
The upshot being that this code:
Code:
local t = 0
GetFrameTimeSeconds()
gives an IDE warning:
Code:
This variable is defined as type `number`. Cannot convert its type to `gameTimeInSeconds`.
- `gameTimeInSeconds` cannot match `number`
- Type `gameTimeInSeconds` cannot match `number`Lua Diagnostics.(cast-local-type)
Just wanted to know if I'm missing something obvious?
Thanks,
David