Type checking not working across scopes #2351
-
Beta Was this translation helpful? Give feedback.
Answered by
carsakiller
Sep 29, 2023
Replies: 2 comments
-
The language server is treating You can mark the type of ---@type playdate.graphics.sprite
local playerSprite = nil |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Peter-Oestergaard
-
Thanks. That's what I needed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The language server is treating
playerSprite
as eitherplaydate.graphics.sprite
ornil
, because, like you said, the setup function theoretically could not run.You can mark the type of
playerSprite
asplaydate.graphics.sprite
at its definition: