Why is TS dumb here?
https://www.typescriptlang.org/play?#code/MYGwhgzhAEDCDy8Ay0DeAoa0DaBrApgJ4Bc0EALgE4CWAdgOYC6pAFAG5ggCu+p5AFtQgBKaAF4AfGSp166AL7p0oSDHgBpaPgAe5fLQAmMBMjSZoIAPYh2nHsIxYswS7QjX8AOiv1b3fMLmWJT45FyUtNAARC7WUeaK8kA
Basically, why does it type the method param as
any
when I declare what type it is in the parent class? Is there a way to make that work?TS Playground - An online editor for exploring TypeScript and JavaS...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
4 Replies
It knows the proper type when it's incorrect...
i don't think that is possible
GitHub
Experiment with always using parameters from base types for derived...
Note some related issues for doing this with properties rather than methods: #3667, #6118, #1373. Goal We want to make it easier for users to derive types without rewriting the same parameter signa...
Ok thanks