Commit graph

2237 commits

Author SHA1 Message Date
Ron Buckton 17762c480d
Fall back to (Async)IterableIterator if (Async)Generator not found (#32303) 2019-07-15 13:41:17 -07:00
Andrew Branch 4f3412153a
Parse quoted constructors as constructors, not methods (#31949)
* Parse quoted constructors as constructors, not methods

* Update baselines

* Fix disambiguation between quoted constructor and property named constructor

* Clean up parsing a bit

* Support escapes in constructor name

* Update baselines
2019-07-12 14:01:57 -07:00
Andrew Branch 8516127a05
Fix regression of generic T assignability to Partial<T> (#32354) 2019-07-12 07:57:55 -07:00
Anders Hejlsberg de2fb9584e Add regression test 2019-07-04 16:27:03 -10:00
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
Andrew Branch 16bbb4d002
Merge pull request #32077 from andrewbranch/bug/31114
Fix incorrect noImplicitAny error on contextual union function signature
2019-07-03 10:10:10 -07:00
Anders Hejlsberg 340f81035f
Merge pull request #32178 from microsoft/improveTupleDestructuring
Simplify tuple destructuring logic
2019-07-02 17:25:12 -07:00
Andrew Branch 327bc3cb67
Merge pull request #32071 from andrewbranch/bug/31070
Allow assignability of non-empty object to generic mapped type
2019-07-01 13:18:44 -07:00
Andrew Branch 23f1d5ccb7
Merge pull request #32117 from andrewbranch/bug/31460
Fix declaration emit for negative number properties, allow negative numbers as computed type property names
2019-07-01 10:56:56 -07:00
Anders Hejlsberg f89165d072
Merge pull request #32049 from microsoft/noDuplicateIntersectionSignatures
Remove duplicate signatures in intersections
2019-06-30 19:38:37 -07:00
Anders Hejlsberg 5ad3d1bf08 Add more tests 2019-06-30 08:18:01 -10:00
Nathan Shively-Sanders 8454ef114d JSDoc:Treat tokens between backticks as comments
even `@`, which would otherwise start a new tag.
2019-06-26 16:04:46 -07:00
Klaus Meinhardt 392d775095 allow const-assertion on aliased enum symbol (#32110)
Fixes: #32087
2019-06-26 14:42:06 -07:00
Andrew Branch 5ff3cda078
Add some negative test cases and accept baselines 2019-06-26 14:01:50 -07:00
Andrew Branch 17f6f77de5
Fix declaration emit for negative number property declarations 2019-06-26 11:49:45 -07:00
Andrew Branch 252840ad40
Fix incorrect noImplicitAny error on contextual union function signature 2019-06-24 17:37:14 -07:00
Andrew Branch 7bbd299226
Look at properties of constraint-instantiated optional mapped types when deciding assignability 2019-06-24 15:19:43 -07:00
Anders Hejlsberg 076d9ad2ab Add regression test 2019-06-23 09:19:56 -10:00
Anders Hejlsberg 9223f39f53 Add regression test 2019-06-21 18:07:15 -10:00
Anders Hejlsberg 6def72b3a4
Merge pull request #31950 from microsoft/unionObjectAndArrayLiterals
Union inferences from object and array literals
2019-06-20 09:36:20 -07:00
Anders Hejlsberg 51712fb1ae Add tests 2019-06-17 16:18:13 -10:00
Ron Buckton 179381301e
Move class property transform (#31848)
* Revert "Revert "Move class property transformation into new transformer. (#30467)""

This reverts commit 53467ae4a4.

* Fix emit issues
2019-06-17 14:26:42 -07:00
Anders Hejlsberg 98bbb22bc4 Add tests 2019-06-09 10:18:36 -07:00
Anders Hejlsberg 9cc9fb9bd7 Update tests 2019-06-09 08:00:01 -07:00
Anders Hejlsberg 9d2a2c9634 Add tests 2019-06-06 13:33:36 -07:00
Anders Hejlsberg 59dc85797e Add regression test 2019-05-31 11:04:02 -07:00
Wesley Wigham e70f2af25d
Defer union or intersection property type normalization (#31486)
* Defer union or intersection property type normalization

* Accept moved span
2019-05-28 10:51:47 -07:00
Andrew Branch a06ab8532c
Merge pull request #31560 from andrewbranch/bug/31485
Fix crash when creating a union signature from signatures that do and don’t have `this` types
2019-05-24 10:30:47 -07:00
Ron Buckton dfd28d2751
Fix handling of empty 'types', 'typings', etc. fields in package.json (#31539) 2019-05-23 17:19:32 -07:00
Andrew Branch a2b40292fe
Merge pull request #31542 from andrewbranch/bug/31481
Error when writing to rest element range of readonly tuple
2019-05-23 13:38:09 -07:00
Anders Hejlsberg e6013335b9
Merge pull request #31537 from microsoft/fixIndexedAccessConstraint
Fix indexed access constraint
2019-05-22 18:35:15 -07:00
Andrew Branch 300cbef071
Don’t crash when creating a union signature from signatures that do and don’t have this types 2019-05-22 17:42:05 -07:00
Andrew Branch 9f6791a5ab
Error when writing to readonly tuple in rest element range 2019-05-22 15:03:17 -07:00
Andrew Branch eecb6d9049
Add failing test 2019-05-22 13:39:05 -07:00
Ron Buckton 6a559e37ee
Fix crash when checking invalid object rest (#31530) 2019-05-22 11:20:57 -07:00
Ron Buckton c3055e585d
Fix compiler crash with object rest in catch binding (#31522) 2019-05-22 11:20:07 -07:00
Ron Buckton b3dc32fec7
Reset error record in downlevel for-of (#31519) 2019-05-22 11:18:07 -07:00
Ron Buckton 7611c5b931
Fix for computed properties in instance initializers (#31517) 2019-05-22 11:17:54 -07:00
Nathan Shively-Sanders b36c8a0690
Make anyArray.filter(Boolean) return any[], not unknown[] (#31515)
* Add this-parameter workaround to Array.filter

Allows anys.filter(Boolean) to once again return any[], not unknown[].

* Add any constraint to Boolean factory function

I want to test how well this works.

* Remove Boolean factory type guard

* Remove typeGuardBoolean test
2019-05-22 09:45:41 -07:00
Anders Hejlsberg 2fd4aaee92 Add regression test 2019-05-22 06:54:16 -07:00
Anders Hejlsberg 907664c31c
Merge pull request #31454 from microsoft/fixThisTypeIndexSignature
Permit assignment through index signature of 'this' type
2019-05-20 07:02:52 -07:00
Anders Hejlsberg c6a670d26c Add regression test 2019-05-17 15:59:01 -07:00
Nathan Shively-Sanders eeba30afc8
Fix infinite loop: module.exports alias detection (#31436)
* Fix infinite loop: module.exports alias detection

Previously, module.exports alias detection in the binder could enter an
infinite recursion. Now it does not.

Notably, there are *two* safeguards: a counter limiter that I set at
100, and an already-seen set. I actually prefer the counter limiter code
because it's foolproof and uses less memory. But it takes 100
iterations to escape from loops.

* fix space lint

* Remove already-seen map
2019-05-17 12:50:39 -07:00
Anders Hejlsberg ee59cee381 Add regression test 2019-05-10 09:56:17 -07:00
Andrew Branch 56b19c9bf0
Merge pull request #31119 from andrewbranch/bug/31020
Emit grammar error on quoted constructors and class fields named “constructor”
2019-05-01 10:42:16 -10:00
Andrew Branch 90d3acf6c7
Merge pull request #31078 from andrewbranch/bug/30752
Fix symbol merging of augmentations to pattern ambient modules
2019-04-30 06:18:23 -10:00
Forbes Lindesay 3ce3cde493 Allow Boolean() to be used to perform a null check (#29955)
* Allow Boolean() to be used to perform a null check

* Add missing test case output
2019-04-30 08:09:31 -07:00
Anders Hejlsberg be409fad84
Merge pull request #31137 from Microsoft/fixConditionalInference
Fix conditional type inference involving any or unknown
2019-04-30 06:26:02 -07:00
Anders Hejlsberg a539887893
Merge pull request #31150 from Microsoft/fixReadonlyIndexedAccess
Fix readonly indexed access used in indexed access type
2019-04-29 16:59:13 -07:00
Ron Buckton 2d8527f3f0
Merge pull request #30779 from Microsoft/relateDiscriminants
Relate source types covered by a target discriminated union
2019-04-29 16:58:27 -07:00