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
This has likely been asked before, and suspect there has probably been some consensus reached on the following. But curious with respect to the following implementation that seems to allow for breaking issues when not compiling in strict and Parameter 'x' implicitly has an 'any' type errors when compiling in strict when the type of x should be obvious.
interfaceIFoo{add(a: number,b: number): number}// class satisfies interface (non-strict)classFooimplementsIFoo{// can't `a` and `b` be inferred to be of type `number` ? publicadd(a,b){returna+b}}constfoo=newFoo()foo.add("hello","world")// allowed (non-strict)
Are there any future plans to perhaps have TS statically resolve the arguments a and b when implementing from an interface in this way?
Many Thanks
The text was updated successfully, but these errors were encountered:
Hi,
This has likely been asked before, and suspect there has probably been some consensus reached on the following. But curious with respect to the following implementation that seems to allow for breaking issues when not compiling in
strict
andParameter 'x' implicitly has an 'any' type
errors when compiling in strict when the type ofx
should be obvious.Are there any future plans to perhaps have TS statically resolve the arguments
a
andb
when implementing from an interface in this way?Many Thanks
The text was updated successfully, but these errors were encountered: