Commit Graph

4097 Commits

Author SHA1 Message Date
Oleksandr T
088fdf6efe fix(51202): Circular instantiation expression crashing IDEs (#51214) 2023-02-17 11:31:45 -08:00
Mateusz Burzyński
a3b516f6ab Add an extra test case for inferring return type of generic class without a constructor (#52741) 2023-02-16 18:56:42 -08:00
Jake Bailey
d79eb02de3 Prefer using enum literal's own base type rather than enum's base type in comparison (#52703) 2023-02-16 07:44:06 -08:00
Anders Hejlsberg
7d00bb078d Widening and non-widening computed enum types (#52542) 2023-02-14 16:25:46 -08:00
Anders Hejlsberg
84b8483206 Improvements to strictSubtypeRelation and getNarrowedType (#52282) 2023-02-14 12:12:42 -08:00
Oleksandr T
a8b4a3b637 fix(52061): Constructor parameters exported as type included in emitted metadata (#52138) 2023-02-14 12:03:54 -08:00
Ron Buckton
f23dd7a7b2 Fix crash in getAwaitedType (#52752) 2023-02-14 11:16:12 -05:00
Anders Hejlsberg
72fb827045 Check conditional types in depth in isTypeParameterAtTopLevel (#52648) 2023-02-14 07:33:22 -08:00
Jake Bailey
79df2bcd35 Don't allow everything to be assignable to string within string mappings like Uppercase/Lowercase (#52734) 2023-02-13 17:58:56 -05:00
Mateusz Burzyński
738b45e219 Fixed crash in checkExportsOnMergedDeclarationsWorker (#52740) 2023-02-13 11:24:15 -08:00
Anders Hejlsberg
c838b0cb7e Consult cached contextual types only when no contextFlags (#52611) 2023-02-10 11:17:59 -08:00
Jake Bailey
0ef9e8eac9 Ensure we treat "type assertions" as JSX within a unary expression (#52667) 2023-02-09 11:34:47 -08:00
Jake Bailey
bec0fdac23 Add test for already fixed issue 49778 (#52668) 2023-02-09 11:04:07 -08:00
Gabriela Araujo Britto
9a14949686 Fix accessing toString of features map (#52340) 2023-02-09 10:22:22 -08:00
Anders Hejlsberg
57ebd99ff2 Exclude typeof this from check in isConstantReference (#52680) 2023-02-09 07:06:09 -08:00
Oleksandr T
cdeb1e3660 feat(48702): Emit for dynamic import (import()) when target >= ES2020 and module == None (#50942) 2023-02-06 16:18:06 -08:00
Mateusz Burzyński
76c23e43da Fixed binding element types coming from the out of tuple bounds under noUncheckedIndexedAccess (#52318) 2023-02-06 16:17:05 -08:00
Jake Bailey
59844e7f6c Don't consult JSDoc outside of JS in expando function assignment declarations (#52640) 2023-02-06 15:28:21 -08:00
Anders Hejlsberg
720ec45be5 Improve handling of corner cases in narrowTypeByInstanceof (#52592) 2023-02-06 11:32:33 -08:00
Oleksandr T
70d14f3de2 fix(52594): this incorrectly applies in TS files in typeToString (#52610) 2023-02-06 08:59:32 -08:00
Mateusz Burzyński
c9b5f2b022 Replace missingType with undefinedType in the IndexedAccessTypeNode's type (#52016) 2023-02-03 16:32:22 -08:00
Tobias S
066c78d590 return baseType in getSubstitutionType when baseType is any (#52573) 2023-02-03 08:35:10 -08:00
Andrew Branch
4ec9b2f8d7 Fix crash when looking for __esModule during symbol table merging (#52554) 2023-02-02 09:27:10 -08:00
Anders Hejlsberg
30993855fd Consistently propagate intersectionState in relations (#52392) 2023-02-02 07:19:00 -08:00
Mateusz Burzyński
c72d9292d9 Fixed accidental propagation of caching-related objectFlags (#52546) 2023-02-01 13:18:19 -08:00
Oleksandr T
3880fce249 fix(52455): destructuring function props with "enum" as property name breaks .d.ts (#52544) 2023-02-01 11:44:22 -08:00
Anders Hejlsberg
d656487fca Permit instantiation expressions in typeof import(...) (#52532) 2023-02-01 09:09:55 -08:00
Jake Bailey
95840557bf Prevent valid JSX from being seen as the start of a generic arrow function, fix crashes (#52450) 2023-01-31 16:55:48 -08:00
Oleksandr T
7c220232f2 fix(52514): overload Tags do not receive noImplicitAny errors on missing return types (#52518) 2023-01-31 09:41:42 -08:00
Oleksandr T
3c0a3e536c fix(52440): typeof ... === "undefined" check on mapped object member doesn't narrow correctly, for only some purposes (#52456) 2023-01-30 10:28:38 -08:00
Jake Bailey
477ec2c3a8 Get export symbol if needed for verbatimModuleSyntax check on default/equals exports (#52448) 2023-01-27 10:13:56 -08:00
Mateusz Burzyński
45c246f28c Fixed a mistake in the narrowingDestructuring test (#52411) 2023-01-25 10:50:29 -08:00
Oliver Radini
a311e25305 Add 2023 array methods to target features (#52242) 2023-01-25 10:31:53 -08:00
Jake Bailey
be488fa075 Revert part of catch clause PR which broke other declarations (#52403) 2023-01-25 10:24:25 -08:00
Jake Bailey
87c808ff2a Add test case for #52271 (#52333)
Fixes https://github.com/microsoft/TypeScript/issues/52271
2023-01-23 11:59:24 -08:00
Oleksandr T
1d81c1dfef fix(51521): Using a of property declared after an initializing constructor triggers an assertion failure in JS (#51524)
Fixes https://github.com/microsoft/TypeScript/issues/51521
2023-01-20 14:43:23 -08:00
Tobeyyy
e01ced050c fix type checking of variables named "exports" (#52209) 2023-01-19 16:59:07 -08:00
Andrew Branch
cfe1842adf Add verbatimModuleSyntax, deprecate importsNotUsedAsValues and preserveValueImports (#52203) 2023-01-19 16:56:30 -08:00
Jake Bailey
6622308206 Add followup test to #52123 test (#52178) 2023-01-19 12:53:03 -08:00
Jake Bailey
b7f619d25e Make catch clause checking consistent with variable declarations (#52240) 2023-01-19 11:56:37 -08:00
Nathan Shively-Sanders
ecaf6d91a7 Revert "Add undefined to JSON.stringify return type (#51897)" (#52307) 2023-01-19 09:24:31 -08:00
Mateusz Burzyński
16c695cdbb Improve uncalled function check related to parenthesized and binary expressions (#50756)
fixes https://github.com/microsoft/TypeScript/issues/37598
2023-01-17 13:22:16 -08:00
Mykola Basov
cb4c7689e6 Add Array.prototype.findLast() and Array.prototype.findLastIndex() (#49636)
Signed-off-by: mbasov2 <mbasov2@bloomberg.net>
2023-01-13 15:35:50 -08:00
Anders Hejlsberg
41e4139357 Only used cached undefined contextual type for requests with no flags (#52224) 2023-01-13 10:10:56 -08:00
Anders Hejlsberg
59e4e38d08 Don't widen when type parameter occurs at top level in type predicate (#52031) 2023-01-12 13:18:36 -08:00
Wesley Wigham
9da2a9aa84 Fix inferences between alias type arguments and defaulted alias type arguments (#51771) 2023-01-11 15:28:53 -08:00
Jake Bailey
28e4c81794 Tweak co/contra inference logic from #52123 (#52180) 2023-01-10 17:08:36 -08:00
Jake Bailey
b3eca6883c Suppress resolvedUsingTsExtension during loadModuleFromDirectory (#52189) 2023-01-10 16:05:44 -08:00
Mateusz Burzyński
32da8a2856 Add a test for indexed access on generic mapped type (#52069) 2023-01-10 13:46:20 -08:00
Mateusz Burzyński
48b6b8b1d9 Add a regression test for mapped type with as clause that bypassed interface extension check (#52070) 2023-01-10 13:45:38 -08:00