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
index.ts(23,14): error TS2420: Class 'Class' incorrectly implements interface 'IClass'.
Types of property 'config' are incompatible.
Type '<T extends IOptions, K extends keyof T>(key: K, value: T[K]) => void' is not assignable to type '<T extends IOptions, K extends keyof T>(key: K, value: T[K]) => void'. Two different types with this name exist, but they are unrelated.
Types of parameters 'key' and 'key' are incompatible.
Type 'K' is not assignable to type '"name"'.
Type 'keyof T' is not assignable to type '"name"'.
The text was updated successfully, but these errors were encountered:
This is working as intended and is an effect of #16368. When relating the config methods in the example it isn't possible for the checker to conclude that the T type parameters are related because no parameters use T in a manner from which inferences can be made. This also means that in calls to config it isn't possible to infer type arguments for T, so such calls will always just default to the IOptions bound unless type arguments are explicitly specified--which in turn means the T type argument is pretty much pointless.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.4.2
Code
Expected behavior:
No Error
Actual behavior:
The text was updated successfully, but these errors were encountered: