You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When creating a class and overloading its operators, the extension doesn't seem to detect the new return value of the operation. The result is detected as a "number":
--- Class representing Vectors.--- @classVector--- @fieldxnumber--- @fieldynumberVector= {}
--- Constructor of Vector.--- @paramxnumber--- @paramynumber--- @returnVectorfunctionVector:new(x, y)
locale= {}
setmetatable(e, self)
self.__index=selfe.x=xor0e.y=yor0returneend--- Add to another Vector.--- @paramvVector--- @returnVectorfunctionVector:__add(v)
returnVector:new(self.x+v.x, self.y+v.y)
endlocalv=Vector:new(3, 4)
v=v+Vector:new(1, 2) --- Warning hereprint(v)
To Reproduce
Create a class and overload the operators. (See the code above).
Expected behavior
This shouldn't trigger a warning: since __add is documented, the result of the operation should be detected as a Vector (or at least an "any" for a sum/div/... with tables).
Environment:
OS: Windows 10 x64
Is WSL remote? No
Client: VSCode
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating a class and overloading its operators, the extension doesn't seem to detect the new return value of the operation. The result is detected as a "number":
The __add function is detected:
But there is still a warning:
This may be related to #599, but I'm not sure.
To Reproduce
Create a class and overload the operators. (See the code above).
Expected behavior
This shouldn't trigger a warning: since __add is documented, the result of the operation should be detected as a Vector (or at least an "any" for a sum/div/... with tables).
Environment:
The text was updated successfully, but these errors were encountered: