Commit graph

18 commits

Author SHA1 Message Date
Ron Buckton e8bf9584aa
Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Ron Buckton f67afa098f Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
Kanchalai Tanglertsampan 1415cf4ea2 Update tests and baselines to declare class declaration before use 2017-02-24 17:48:06 -08:00
Anders Hejlsberg b14b24a96e Update tests 2016-09-21 16:03:51 -07:00
Jason Freeman 197a42a692 Optimize direct Iterable reference in getIteratedType 2015-03-25 18:38:14 -07:00
Jason Freeman 7dd7b43448 Add one more test 2015-03-02 13:53:59 -08:00
Jason Freeman cb97686496 Add tests for scoping 2015-03-01 18:16:20 -08:00
Jason Freeman 84a22be433 Add a few more tests 2015-02-26 18:17:58 -08:00
Jason Freeman f8150d3734 Support assignment patterns in 'for...of' statements 2015-02-26 18:17:54 -08:00
Jason Freeman 00408a68d3 Add tests for for-of destructuring 2015-02-26 18:17:44 -08:00
Jason Freeman f3543b718f In ES6, an Iterable should contextually type an array literal 2015-02-26 18:17:41 -08:00
Jason Freeman 034bd09526 Add tests for circular references in for...of loops 2015-02-26 18:17:35 -08:00
Jason Freeman 0049b21d6c Check for assignability to the relevant iteratable type 2015-02-26 18:17:31 -08:00
Jason Freeman 732637dd54 Fix getIteratedType to work with 'any' at all levels 2015-02-26 18:17:28 -08:00
Jason Freeman 057108646d More tests 2015-02-26 18:17:25 -08:00
Jason Freeman 3d5c113bee Iterator tests 2015-02-26 18:17:21 -08:00
Jason Freeman ec9e563238 Add tests and accept correct baselines 2015-02-26 18:17:08 -08:00
Jason Freeman aa06622695 Basic tests 2015-02-26 18:17:02 -08:00