Commit Graph

4326 Commits

Author SHA1 Message Date
Mateusz Burzyński
5b10466b63 Prevent ObjectFlags.IdenticalBaseTypeExists and ObjectFlags.IsConstrainedTypeVariable confusion (#56711) 2023-12-11 10:24:32 -08:00
Mateusz Burzyński
41ec497211 Defer conditional types with parenthesized multi-element tuple types in extends clause (#56271)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-12-08 12:21:04 -08:00
Ryan Cavanaugh
8456dccbda Directly copy only the index signature in addition to declared properties (#56626) 2023-12-07 12:25:50 -08:00
Oleksandr T
7e1c297730 fix(53181): Overloads Are Not Generated as Expected When Using JsDocOverload Tag to Declare Overloads of Functions Assigned to a Prototype (#53317)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-12-06 06:27:27 -08:00
Mateusz Burzyński
993ffd70e6 Improve contextually typed parameters with initializers (#56506) 2023-12-05 10:56:02 -08:00
Mateusz Burzyński
6edfef8c0d Fixed an issue with reverse mapped types inference when single type variable is left after inferring from matching types (#55941)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 14:57:52 -08:00
Mateusz Burzyński
8d1fa440dd Defer processing of nested generic calls that return constructor types (#54813)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 11:24:04 -08:00
Andrea Simone Costa
eb2046d046 Reverse mapped types with intersection constraint (#55811)
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 11:21:28 -08:00
Anders Hejlsberg
3258d75169 Reduce intersections of constrained type variables and primitive types (#56515) 2023-11-30 07:04:09 -08:00
Mateusz Burzyński
f834133fe2 Correctly resolve declared type for late bound property symbols of function expressions (#55357)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-30 07:02:48 -08:00
Mateusz Burzyński
afffad43f4 Allow non-generic return types to be read from single generic call signatures (#54477)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-29 15:40:43 -08:00
Mateusz Burzyński
0e610182d8 Avoid pulling object function property augmentations when resolving intersections' properties (#54753)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-11-29 15:37:13 -08:00
Mateusz Burzyński
e5513254a3 Fixed symbol lookup for binding expando properties in blocks (#56552) 2023-11-29 13:06:34 -08:00
Linus Groh
aef29e400e Add types for Promise.withResolvers() (#56593) 2023-11-29 08:55:55 -08:00
Sheetal Nandi
13c9b16b2a When reparsing top level await dont set original node for the new source file (#56439) 2023-11-21 13:35:49 -08:00
Mateusz Burzyński
2c0c128e98 Avoid incorrect narrowings using const variables from binding elemens with literal initializers (#56347) 2023-11-21 12:24:02 -08:00
Jake Bailey
0aa2c48ee3 Make our dts files compile when exactOptionalPropertyTypes is enabled downstream (#56489) 2023-11-21 11:40:31 -08:00
Anders Hejlsberg
38ef79e0b0 Improve constraints of conditional types applied to constrained type variables (#56004) 2023-11-20 17:08:22 -08:00
Anders Hejlsberg
3e094edc97 Only call getLowerBoundOfKeyType on non-generic mapped types (#56280) 2023-11-20 17:07:07 -08:00
Anders Hejlsberg
9302332481 Propagate intersectionState in typeRelatedToSomeType (#56207) 2023-11-20 17:05:43 -08:00
Mateusz Burzyński
dac1da8434 Add a test case for lack of duplicate property errors (#56348) 2023-11-20 12:10:38 -08:00
EliLichtblau
9063d7b41d Error on export default of type: issue https://github.com/microsoft/TypeScript/issues/55087 (#55097)
Co-authored-by: eli lichtblau <elilichtblau@elis-MacBook-Pro.local>
Co-authored-by: Andrew Branch <andrew@wheream.io>
2023-11-20 10:19:57 -08:00
Mateusz Burzyński
32b618c2d8 Fixed a crash when inferring return type of an accessor with errors in its return statement (#56258) 2023-11-15 17:39:58 -08:00
Sheetal Nandi
cf5d7107a9 Track symbols per type thats cached and dont keep adding to them (#56421)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-11-15 16:29:46 -08:00
Jake Bailey
3333e906dd Revert "Disallow numeric literals with negative numbers (#55268)" (#56422) 2023-11-15 15:51:47 -08:00
Andrew Branch
a6367977d4 isolatedModules error on alias merging with local value (#56354) 2023-11-15 14:11:12 -08:00
Mateusz Burzyński
9f15002959 Fixed narrowing in case clauses that follow other clauses that return (#56358) 2023-11-13 14:41:56 -08:00
Zzzen
7b96c28e8f Add Support for Using Aliased Discriminants in Conditional Statements (#56173) 2023-11-08 15:06:40 -08:00
Jake Bailey
4dd1e2f844 Ensure instantiation expressions have symbols, preventing crash in signature relations (#56064) 2023-11-07 15:59:19 -08:00
Jake Bailey
1ed8ed6c27 Preserve original type parameter names more often when shadowed (#55820)
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2023-11-06 15:45:16 -08:00
Mateusz Burzyński
6a9bc38da8 Do not narrow using JSDoc type assertion nodes (#56048) 2023-11-03 07:04:45 -07:00
Andrew Branch
0ee2db33ca Fix declaration emit in --moduleResolution bundler using wrong exports conditions (#56265) 2023-10-30 15:39:57 -07:00
Oleksandr T
60ce788302 fix(53933): Confusing rules around function parameter names in a type (#53946) 2023-10-30 15:24:14 -04:00
Isabel Duan
29cfca319b add pushTypeResolution to getTypeOfAlias (#52642)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-10-27 18:08:20 -07:00
Mateusz Burzyński
a25321afce Ensure all JSX spread properties get visited in ES2018+ (#55859) 2023-10-27 11:36:21 -07:00
Changwon Choe
598d912f69 Add conditions to check for class extension or implementation of prim… (#55712)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-10-26 12:41:58 -07:00
Mateusz Burzyński
1c49a8ba02 Filter possible contextual return types from unions for async functions and generators (#51196) 2023-10-26 12:03:01 -04:00
Ron Buckton
8e37e4b853 More reliable mechanism for _this/_super simplification (#56130) 2023-10-23 21:01:11 -04:00
Anders Hejlsberg
b76b4c26ca Improve isDeeplyNestedType for homomorphic mapped types (#56169) 2023-10-23 08:53:46 -07:00
Anders Hejlsberg
ac75a5ec9a Fix discriminant property check in CFA (#56156) 2023-10-19 14:04:41 -07:00
Gabriela Araujo Britto
b1f5ef69e8 Improve error message for index signature on generic type when writing (#55906) 2023-10-18 17:43:43 -07:00
Mateusz Burzyński
0e07ff50ae Defer checking expressions in void expressions (#56122) 2023-10-16 10:16:19 -07:00
Mateusz Burzyński
521f8a8caf Ignore awaited self tail calls when collecting the return type of an async function (#56020) 2023-10-10 09:03:18 -07:00
Andrew Branch
d0d406747d Add type reference directive for all visited references to ambient modules (#56015) 2023-10-09 11:38:15 -07:00
Mateusz Burzyński
9144836360 Fixed type narrowing in switch statements with parenthesized expressions (#56035) 2023-10-09 11:36:16 -07:00
Jake Bailey
53a3d24b95 Fix fallthrough and default in new switch-true narrowing (#55991) 2023-10-06 16:23:54 -07:00
Mateusz Burzyński
7377f5cb9d Fixed declaration emit of object literals withs divergent accessors (#55442) 2023-10-05 16:40:45 -07:00
Mateusz Burzyński
758884c093 Add a test for a property of reverse mapped type having a primitive type (#55807) 2023-10-04 13:27:42 -07:00
Mateusz Burzyński
274821eb88 Don't create children prop out of non-semantic JSX children (#55981) 2023-10-04 11:15:43 -07:00
Mateusz Burzyński
d9cd2d0bd0 Fixed a crash in getPropertyNameForPropertyNameNode on NoSubstitutionTemplateLiteral (#55930) 2023-10-02 13:31:38 -07:00