Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Would you have figured out that the solution to the problem was to omit the - factually correct - return type of the method?

While I would not be able to figure out the solution to this problem from the error message alone, I would gather from it that typescript is telling me here that it cannot guarantee that it will satisfy the type contract, i.e. that the function will return a thing of the same generic type T as it received. This is useful information in debugging the type declaration of the function.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: