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
Mateusz Burzyński
94afa32925
Add an extra test case for circular base type ( #52071 )
2023-01-10 13:04:58 -08:00
Gabriela Araujo Britto
2082ef2e3f
fix narrowTypeByDiscriminant for non null expression access ( #52136 )
2023-01-10 09:49:13 -08:00
Wesley Wigham
89e928e8b4
Add --allowArbitraryExtensions, a flag for allowing arbitrary extensions on import paths ( #51435 )
2023-01-09 17:12:42 -08:00
Mateusz Burzyński
9b718d0a70
Add tests for excess property check for intersection containing a recursive type ( #52063 )
2023-01-09 16:02:17 -08:00
Stephen Hicks
6bedd1c227
Allow indirect calls ( #51989 )
...
Co-authored-by: Klaus Meinhardt <klaus.meinhardt1@gmail.com >
2023-01-09 15:56:33 -08:00
Mateusz Burzyński
2c1fda249f
Fixed false positive circular errors for await expressions with simple non-generic calls in CFA loops ( #51126 )
2023-01-09 13:56:52 -05:00
Wesley Wigham
00567618bd
Reuse existing module specifiers in js declaration emit ( #52089 )
2023-01-09 10:15:42 -08:00
Wesley Wigham
11bc7b758d
Issue error on export= in esm mode declaration file ( #52109 )
2023-01-09 10:15:23 -08:00
Gabriela Araujo Britto
e60c210c57
Improve JSX invalid children type error ( #52105 )
2023-01-06 10:26:53 -08:00
Anders Hejlsberg
400e2c2bd8
Defer conditional types with multi-element tuple types in extends clause ( #52091 )
2023-01-06 09:18:12 -08:00
Anders Hejlsberg
fc8538608b
Improve logic that chooses co- vs. contra-variant inferences ( #52123 )
2023-01-06 07:56:51 -08:00
Mateusz Burzyński
31d1d63fc8
Infer fixed-size tuples from infer type parameters with extends clauses at variadic positions ( #51157 )
...
* Infer fixed-size tuples from infer type parameters with extends clauses at variadic positions
* Improve the fix to handle tuples with leading variadic elements
* Fixed indentation
* Infer rest element following a variadic element with a fixed-size constraint
* Infer rest element preceding a variadic element with a fixed-size constraint
* Rewrite the test to avoid accidental union reductions
2023-01-03 10:18:09 -08:00
Mateusz Burzyński
e9cd2e14db
Allow forward references in computed properties of type declarations ( #50824 )
...
* Allow forward references in type declarations
* address PR feedback
2022-12-30 11:37:33 -08:00
Oleksandr T
44152bc22e
fix(29648): Error message related to JSDoc for non-JSDoc syntax error ( #50793 )
...
* fix(29648): improve diagnostics of non-JSDoc syntax errors
* fix lint errors
* update tests
* change diagnostic type suggestion. fix QF for jsdoc nullable type
* move error handling from the parser to the checker
* change diagnostic message. remove speculative parsing
* update baseline
2022-12-29 16:50:57 -08:00
ronyhe
c7f49bceed
Add undefined to JSON.stringify return type ( #51897 )
...
* First attempt
* Revert "First attempt"
This reverts commit 23f641cddb .
* Second try
* Accept baslines
2022-12-28 09:06:03 -08:00
Anders Hejlsberg
acf854b636
Keep track of multiple current inference contexts ( #51978 )
...
* Keep track of multiple current inference contexts
* Add regression test
2022-12-22 07:52:49 -10:00
Anders Hejlsberg
ba793e6069
Fix excess property checking for intersections with index signatures ( #51894 )
...
* Fix excess property checking for intersections with index signatures
* Add regression tests
* Limit check to only fresh object literals on the source side
2022-12-16 06:59:23 -08:00
Oleksandr T
fe185272cf
feat(51000) - Flag Deprecation Plan ( #51424 )
...
* feat(51000): add ignoreDeprecations option
* use constants of versions
* change the ignoreDeprecations type to allow only one value - '5.0'
* add tests
* update baseline
* add typeScriptVersion to CreateProgramOptions
* update baseline
* change diagnostic message
2022-12-15 10:44:06 -08:00
Tomasz Lenarcik
aa2781d44f
Add missing type argument constraints check ( #51766 )
...
* Add missing type argument constraints check
* Leverage existing routine for obtaining typeParameters
2022-12-14 11:20:57 -08:00