We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version:
1.8.0
Code
declare function foo1<T extends U, U>(target: T, source: U); declare function foo2<T extends U, U>(target: T, source: U & { key?: string }); let x = { a: 1, b: 2 }; foo1(x, { c: 3 }); // Error as expected foo2(x, { c: 3 }); // OK (Should be Error)
Expected behavior: call to foo2 should error with the same error as the call to foo1.
foo2
foo1
Actual behavior: call to foo2 infers type parameter U as {}, to which { c: number } is assignable.
U
{}
{ c: number }
cf. #7234
The text was updated successfully, but these errors were encountered:
not sure what is the proposal here, {} for U seems like a correct inference.
Sorry, something went wrong.
please reopen if there is additional information.
No branches or pull requests
TypeScript Version:
1.8.0
Code
Expected behavior:
call to
foo2
should error with the same error as the call tofoo1
.Actual behavior:
call to
foo2
infers type parameterU
as{}
, to which{ c: number }
is assignable.cf. #7234
The text was updated successfully, but these errors were encountered: