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
exportclassFoo{client={getThing: ()=>Promise.resolve('')}foo(): Promise<void>{return(/* TODO: Avoid using type assertions, please refactor. */this.client.getThing()asunknownasPromise<void>);}}
π Actual behavior
exportclassFoo{constructor(){this.client={getThing: ()=>Promise.resolve('')};}foo(){return/* TODO: Avoid using type assertions, please refactor. */this.client.getThing();}}
This means new Foo().foo() essentially returns undefined.
π Expected behavior
foo(){return(/* TODO: Avoid using type assertions, please refactor. */this.client.getThing());}
Additional information about the issue
This happens specifically when the return statement begins with a comment and ends with a type assertion.
The text was updated successfully, but these errors were encountered:
I congratulate you on inventing a brand new term (at least, I can't find any mention of it on Google anywhere), yet one that is immediately understandable to a reader who has never heard it before.
π Search Terms
return, parens, parenthesis, assertion
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.3.2#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwFgAoORJAS2ADt4BeAkssgc2BgBUALC6lgLjgAKAJRw6APjgAFKBAC2FNMAB0UYGghIAbsCEByfSKZwAviRMAzXKMGyFS4AB5tECgBMpRUs3UwArlDUwibMcAD0AFRwHADyACKxggCCrh5w-mi8LHAwAJ5gwHDoyrAUENRoADRwYEjA6EXqligIMNAqcJHhuTxoKshUtKFhcCpsnDx8osWY-tQA1tQQAO7B6DJyisoubp4jIgDcJubEp0A
π» Code
π Actual behavior
This means
new Foo().foo()
essentiallyreturns undefined
.π Expected behavior
Additional information about the issue
This happens specifically when the return statement begins with a comment and ends with a type assertion.
The text was updated successfully, but these errors were encountered: