I have this block of code.
character
is a new object I created using a module. Moving
is a boolean variable and :Move
is simply a method.
if character.Moving then
return
end
character:Move()
This code should work fine, but the problem is that the type solver gets weird and warns that Type 'false' could not be converted into 'true' in an invariant context
. This prevents :Move
from being shown in autocomplete and highlights character
with an orange underline…
Note that the :Move
method is actually typed as function metatable.Move(self: type)
in the module. I made it like that so the type solver will be able to access the properties of self
.
Is this a bug?
Thanks for reading