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
classA{foo='bar'baz(){return{...this}}}consta=newA()constobj=a.baz()obj.baz()// <- No error but: obj.baz is not a function at runtimeconst_obj2={...a}obj2.baz()// <- Correct error
π Actual behavior
When spreading a class instance to an object from within the class itself, resulting properties are still presenting methods in its signature.
π Expected behavior
Discarded methods would be removed from the type.
The text was updated successfully, but these errors were encountered:
Interesting that the second example works (or rather, doesn't work) as expected, though
asnaeb
changed the title
Object derived from detructuring a class instance from within the class body has wrong type information
Object derived from spreading a class instance from within the class body has wrong type information
Mar 14, 2023
Bug Report
π Search Terms
π Version & Regression Information
This happens on any version
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
When spreading a class instance to an object from within the class itself, resulting properties are still presenting methods in its signature.
π Expected behavior
Discarded methods would be removed from the type.
The text was updated successfully, but these errors were encountered: