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: master (8f654f0)
Search Terms: conditional type assignability assignable constraint contravariant infer variable parameter unsound
Code
type Foo<A> = [A] extends [[infer B]] ? (arg: B) => void : never; function fortyTwo<A>(x: Foo<A>) { x(42); } fortyTwo<[string]>((arg: string) => console.log(arg.slice()));
Expected behavior: Compile error on x(42).
x(42)
Actual behavior: Successful compilation and runtime error.
Playground Link: link
Related Issues: #26933
The text was updated successfully, but these errors were encountered:
T
A extends B ? C : D
C
D
What would be the fix for this, substituting the lower bound (never) instead, or just failing?
never
Sorry, something went wrong.
ahejlsberg
No branches or pull requests
TypeScript Version: master (8f654f0)
Search Terms:
conditional type assignability assignable constraint contravariant infer variable parameter unsound
Code
Expected behavior: Compile error on
x(42)
.Actual behavior: Successful compilation and runtime error.
Playground Link: link
Related Issues: #26933
The text was updated successfully, but these errors were encountered: