Commit Graph
34 Commits
Author SHA1 Message Date
Mateusz Burzyński 6684e3d527 Fixed substition types for non-generic indexed accesses (#51621) 2022-12-07 07:47:32 -08:00
Mateusz Burzyński 5cd2d975c3 Fixed an issue with in not being able to be used on narrowed down expression of a generic nullable type (#51502)
* Fixed an issue with `in` not being able to be used on narrowed down expression of a generic nullable type

* Add another test case from a new issue

* Move the fix to `hasEmptyObjectIntersection`
2022-11-22 07:03:58 +01:00
Mateusz Burzyński 39ccac654c Add known keys of the mapped type constraint to its members (#50081)
* Add known keys of the mapped type constraint to its members

* Avoid second pass of adding known members by instead passing `noReductions` to `mapType`
2022-11-07 16:22:27 -08:00
Mateusz Burzyński a329210166 Fixed a regression with discriminating unions based on a union property against undefined with strictNullChecks: false (#49648)
* Fixed a regression with discriminating unions based on a union property against `undefined` with `strictNullChecks: false`

* Add additional test case from the issue comment
2022-11-07 12:17:59 -08:00
Mateusz Burzyński 46b015f2bf Fixed the issue with some longer variadic tuples with any rest being incorrectly assignable to shorter variadic tuples (#50218) 2022-11-02 11:35:17 -07:00
Mateusz Burzyński 85d405a1d7 Fixed a false positive "await has no effect on the type" diagnostic with mixed generic union (#50833) 2022-10-18 14:10:03 -07:00
Mateusz Burzyński 11066b264f Rename internal functions to narrowTypeBySwitchOnTypeOf and narrowTypeByInKeyword (#51215) 2022-10-18 12:58:39 -07:00
Mateusz Burzyński be5f0fe5ac Add an extra regression test for awaited unresolvable recursive union (#51167) 2022-10-13 18:30:35 -07:00
Mateusz Burzyński a8e13f7340 Fixed an issue with destructured bindings from a generic union constraint not being narrowed correctly (#50221) 2022-09-17 14:47:57 -07:00
Mateusz Burzyński 238c341701 Defer distributing index over generic object types (#50540)
* Defer distributing index over generic object types

* Only check if the index type should be deferred for intersection types

* Add an additional test case
2022-09-01 07:28:13 -07:00
Mateusz Burzyński 0e17dc7769 Fixed a false positive related to binding patterns and spread expressions (#49684)
* Fixed a false positive related to binding patterns and spread expressions

* Improve ancestor lookup when checking if an expression is spread into an object

* Fixed ancestor lookup for more node types

* Remove equality check for contextual types

* Reformat code

* Use `isWithinSpreadAssignment` flag + `objectsWithinSpread` cache instead of ancestor traversal

* Revert "Use `isWithinSpreadAssignment` flag + `objectsWithinSpread` cache instead of ancestor traversal"

This reverts commit be387e3bbf.

* Expand on the existing comment
2022-08-08 17:01:50 -07:00
Mateusz Burzyński 5374fd924e Add an additional test for favoring the asserted type in type predicate narrowing (#50065)
* Add an additional test for favoring the asserted type in type predicate narrowing

* Add requested test cases
2022-07-29 12:12:33 -07:00
Mateusz Burzyński cd3bd5522b Fixed an issue with generic naked T not being allowed as async generator's return (#49023) 2022-07-14 15:51:03 -07:00
Mateusz Burzyński 2ef3901940 Fixed initializaiton-time inference for class properties assigned through element access (#49374) 2022-07-13 14:43:23 -07:00
Mateusz Burzyński fefe2208f4 Fixed outdated expectation comments (#49691) 2022-07-07 11:45:52 -07:00
Mateusz Burzyński 8687940398 Add visible alias statements for non-visible binding patterns when emitting declaration (#48869) 2022-07-06 10:08:17 -07:00
Mateusz Burzyński bd11ce2aeb Fixed an issue with self-referential awaited union (#49677) 2022-06-29 13:01:36 -07:00
Mateusz Burzyński 9236e39374 Fixed an issue with contextual type for intersection properties (#48668)
* Add a failing test case for contextual type not provided for functions comming from a property with intersection type

* Fixed an issue with contextual type for intersection properties

* Fixed how type of a property of a contextual type is being computed when intersections with indexers are used
2022-05-09 16:03:48 -07:00
Mateusz Burzyński d337cbc19f Run mocha using process.execPath instead of harcoding "node" (#48797) 2022-05-04 08:23:08 -07:00
Mateusz Burzyński 9469f95bd4 Add tests case for function check type being correctly paranthesized in quick info (#48836) 2022-05-03 17:05:37 -07:00
Mateusz Burzyński 63a941dc2a Add a regression test for completion list in object literal involving inferred obj with optional members (#48910) 2022-05-02 12:27:49 -07:00
Mateusz Burzyński af30c79093 Fixed string literal completions for partially-typed strings when overload could get matched (#48811) 2022-04-22 08:36:14 -07:00
Mateusz Burzyński 702bc5222b Add additional tests for intra expression inference (#48584) 2022-04-06 16:17:53 -07:00
Mateusz Burzyński 3ec1b04808 Add explicit tests for unconstrained type param not being assignable to {} and Record<string, any> (#48421) 2022-03-25 05:36:02 -07:00
Mateusz Burzyński ca65a1a05b Add boolean to supported literals within Object.freeze (#48117) 2022-03-14 09:07:31 -07:00
Mateusz Burzyński 04238e6f52 Fix/dependent parameters obj methods (#48110)
* Add failing test for dependent destructured variables within obj methods

* Fixed an issue with dependent parameters within obj methods
2022-03-11 09:46:30 -08:00
Mateusz Burzyński c1783b28e7 Add a test for emit of a computed property based on an aliased symbol (#47978) 2022-03-04 17:35:19 -08:00
Mateusz Burzyński 6722ef12d3 Add a test for a destructured union with tuple members (#46656) 2021-12-07 15:22:46 -08:00
Mateusz BurzyńskiandNathan Shively-Sanders 998ecd9c06 Add a test for JSX namespace lookup with jsx: preserve, jsxImportSource (#41676)
* Add a test for JSX namespace lookup with `jsx: preserve, jsxImportSource`

* updated baselines

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 09:07:33 -08:00
Mateusz Burzyński 09eb3d3b9c Fix/jsx global preferred over config implicit (#41476)
* Add actual baselines for a problem with global namespace being preferred over config & pragma implicit ones

* Fixed an issue with global React namespace being preferred over config & pragma implicit ones

* Do not try to mark JSX classic runtime symbols as used when automatic runtime is used
2020-11-17 17:52:32 -08:00
Mateusz Burzyński 9fd2c2cb4b Add auto-import for createElement when using the new JSX transform 2020-10-17 19:47:49 +02:00
Mateusz Burzyński 43433eb2f1 Add tests related to the key prop when using new JSX transform 2020-10-17 15:20:39 +02:00
Mateusz Burzyński 3af425b87d Update baseline tests 2018-06-04 23:55:42 +02:00
Mateusz Burzyński 42a5f81570 Use redefining helper pattern for better tree-shakeability 2018-06-04 22:36:23 +02:00