Skip to content
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

Improve the IteratorResult type using boolean literal types #10659

Closed
falsandtru opened this issue Sep 1, 2016 · 2 comments
Closed

Improve the IteratorResult type using boolean literal types #10659

falsandtru opened this issue Sep 1, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@falsandtru
Copy link
Contributor

falsandtru commented Sep 1, 2016

TypeScript Version: master

https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es2015.iterable.d.ts#L27-L30

Expected behavior:

type IteratorResult<T>
  = {
    done: false;
    value: T;
  }
  | {
    done: true;
    value?: void;
  };

Actual behavior:

interface IteratorResult<T> {
    done: boolean;
    value: T;
}
@yortus
Copy link
Contributor

yortus commented Sep 1, 2016

I think this is covered by #2983.

@falsandtru
Copy link
Contributor Author

Right, thanks.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Sep 1, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants