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
Expected behavior:
Both calls to foo should use the first overload (and deduce T as number).
Actual behavior:
The first call to foo uses the second overload and both C and T are deduced as {} (i.e foo<{}, {}>). If the second overload is removed, the program fails to compile:
TS2345: Argument of type 'SomeInterface' is not assignable to parameter of type 'Map<{}>'.
Index signature is missing in type 'SomeInterface'.
(and other 2 errors since key and value would implicitly become any)
This might be some intended difference between interface and type that I didn't see documented anywhere, but I'm posting this here just to be sure.
The text was updated successfully, but these errors were encountered:
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.5.2
Code
Expected behavior:
Both calls to
foo
should use the first overload (and deduce T asnumber
).Actual behavior:
The first call to
foo
uses the second overload and both C and T are deduced as{}
(i.efoo<{}, {}>
). If the second overload is removed, the program fails to compile:(and other 2 errors since
key
andvalue
would implicitly becomeany
)This might be some intended difference between
interface
andtype
that I didn't see documented anywhere, but I'm posting this here just to be sure.The text was updated successfully, but these errors were encountered: