-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
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
Error inferring tuple type arguments #16360
Comments
This was referenced Jun 9, 2017
Seems like a duplicate of #19194 |
@mhegazy I don't think this is a duplicate -- that issue references the actual interface IPromise<T> {
then(onFulfill: (value: T) => void): void;
}
interface QPromise<T> {
then(onFulfill: (value: T) => void): void;
}
type IWhenable<T> = IPromise<T> | T;
declare function unwrapTwice<T>(p: IWhenable<IWhenable<T>>): T;
declare const qq: QPromise<QPromise<string>>;
const x: string = unwrapTwice(qq); // Error: unwraps once... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypeScript Version: nightly (2.4.0-dev.20170608)
Code
Expected behavior:
Since
IPromise
andQPromise
have identical bodies, I would expect these to both work.Actual behavior:
x1
fails,x2
succeeds.The text was updated successfully, but these errors were encountered: