Commit Graph

4158 Commits

Author SHA1 Message Date
Jake Bailey 01de7885a4 Avoid calculating union in spread if property types are identical (#53413) 2023-03-21 14:44:47 -07:00
SHIMA RYUHEI 84a09c762b Accurate constraintType for indexedAccessType (#53059) 2023-03-21 12:54:05 -07:00
Anders Hejlsberg 3d2c3442db Fix recursive type inference (#53396) 2023-03-21 12:53:16 -07:00
Anders Hejlsberg bace6897e2 Fix subtype reduction involving type variables with union constraints (#53351) 2023-03-21 12:52:05 -07:00
Kevin Gibbons de31ebecea More explicit error message for function signature length mismatches (#51457)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-03-21 09:09:22 -07:00
Jake Bailey b168b246b7 Make deeplyNestedTemplateLiteralIntersection run a little faster (#53401) 2023-03-20 17:43:04 -07:00
Mateusz Burzyński f078ab0548 Avoid rewriting homomorphic mapped types with homomorphic instantiations (#53215) 2023-03-20 17:09:42 -07:00
Jake Bailey e9836a4bec Ensure rest type for source parameter is readonly in relations (#53258) 2023-03-20 16:18:52 -07:00
Mateusz Burzyński acfb0b53d1 Make function properties context-sensitive based on their return statements (#50903) 2023-03-20 13:53:16 -07:00
Nebojša Cvetković 4fcb8b8be6 Consider all union types matching discriminator for excess property checks (#51884)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-03-20 13:50:23 -07:00
Jake Bailey 3ba3ace236 Remove incorrect handling of intersections in getStringMappingType (#53383) 2023-03-20 13:44:25 -07:00
Wesley Wigham 001aa99734 Fix crash when importsNotUsedAsValues is set alongside verbatimModuleSyntax (#53386) 2023-03-20 12:30:11 -07:00
Mateusz Burzyński 3fab5fff34 Fixed issues with inference from nested tuple types of the same shape (#49226) 2023-03-20 11:18:08 -07:00
Oleksandr T 9e1f0adf61 feat(25758): Computed properties no throws if there is a duplicate (#49848) 2023-03-20 11:16:00 -07:00
Mateusz Burzyński 1ed06e6b05 Fixed an issue with not being able to use mapped type over union constraint as rest param (#49947) 2023-03-20 11:14:25 -07:00
Mateusz Burzyński 56aa3d522b Normalize generic tuple types with Simplifiable elements (#52385) 2023-03-20 11:10:31 -07:00
Mateusz Burzyński a5e6dee6b2 Do not infer to mapped types from implied index signatures created by rest bindings (#52632) 2023-03-20 11:06:26 -07:00
Jake Bailey 716b592e55 Revert fix for intersections in template literals, fix differently (#52836) 2023-03-19 19:48:32 -07:00
Jake Bailey b7b0b52d68 Disallow instantiation expressions on the right side of instanceof (#53323) 2023-03-17 15:32:00 -07:00
Kagami Sascha Rosylight f473058361 Allow implicit return with explicit undefined return type (#53092)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2023-03-17 12:08:01 -07:00
Mateusz Burzyński b8c71685f9 Add an extra test case related to return statements and annotated return types (#52628) 2023-03-16 14:58:03 -07:00
Mateusz Burzyński a6ba2e735d Collect contravariant-only inference candidates from shorter annotated functions (#52609) 2023-03-16 11:00:36 -07:00
Zzzen cfd550e397 Avoid bogus circularity error on context sensitive expando assingment (#50487)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-03-16 10:12:23 -07:00
Jake Bailey e0124040f0 Revert PR #52589 (#53280) 2023-03-16 09:59:02 -07:00
Jake Bailey 7f292bf2a1 Revert PR #51580 (#53283) 2023-03-15 20:19:23 -07:00
Mateusz Burzyński 63495beb1a Fixed an issue with spreading a spreadable generic expression into generic JSX (#51580) 2023-03-15 14:57:37 -07:00
Jake Bailey dfa30bbe2a Ensure moduleType is structured during cloneTypeAsModuleType (#51136) 2023-03-15 12:56:11 -07:00
Mateusz Burzyński 074bf34633 Do not resolve apparent type of mapped types with a tuple constraint (#52651) 2023-03-15 10:46:12 -07:00
Wesley Wigham 2b9d792828 Fix #33569 - Enable declaration emit for late-bound function members (#53034) 2023-03-15 10:20:35 -07:00
Anders Hejlsberg 9769421a63 Defer resolution of indexed access types with reducible object types (#53098) 2023-03-14 14:15:32 -07:00
Sheetal Nandi 46d70d79cd When resolving type reference from custom typeRoot localtion use mangled scope name if the package is scoped name (#53166) 2023-03-10 09:58:41 -08:00
Mateusz Burzyński e7753831e9 Filter out non-array types when contextually typing array literal elements (#52589) 2023-03-10 09:34:03 -08:00
Oleksandr T 2ab9e7edd9 fix(53011): Illegal declaration file can be emitted (duplicate parameter names) when spreading tuples into parameter positions (#53028) 2023-03-09 09:47:49 -08:00
Mateusz Burzyński d681520a14 Fixed array expression spreads into variadic const calls (#52845) 2023-03-08 14:45:58 -08:00
Mateusz Burzyński 615a97b1d4 Add an extra test for excess property check for intersection containing a recursive type (#53100) 2023-03-08 12:34:47 -08:00
navya9singh 74a37f8203 Fix(49702): LS crash in binder for module in a JS file (#52537) 2023-03-08 09:42:18 -08:00
Zzzen 0ce551752d check computed property names in overloads (#52427) 2023-03-08 09:20:33 -08:00
jihndai 4af97b0572 Fix compound assignments for properties with different getter & setter types (#50431) 2023-03-07 16:02:16 -08:00
Mateusz Burzyński 2f229ab870 Add an extra test for contextually typed return of async function (#52613) 2023-03-07 15:30:40 -08:00
Jake Bailey 868331f2be Fix deprecations, improve messaging (#52993) 2023-03-07 09:39:45 -08:00
Mateusz Burzyński 6dbec02a88 Add extra test cases for the Awaited type (#53090) 2023-03-06 23:14:57 -08:00
Mateusz Burzyński 7e4592ea09 Add an extra test case for deferred conditional types (#53067) 2023-03-06 13:46:11 -08:00
Mateusz Burzyński 61a8e2c5b7 Add a test for an error on required JSX children when an empty JSX expression is used (#53113) 2023-03-06 13:24:15 -08:00
Mateusz Burzyński 9c7f43dfd8 Add extra test cases for indexed access on generic mapped type (#53112) 2023-03-06 10:20:00 -08:00
Anders Hejlsberg 6823559fa9 Check for strict subtypes and then regular subtypes in getNarrowedType (#52984) 2023-03-03 15:56:17 -08:00
Mateusz Burzyński a34d5ae1ed Add extra test cases for Awaited<T> inference (#53068) 2023-03-03 09:47:14 -05:00
Mateusz Burzyński 6b71882c4c Fixed spreading iterables into arguments list directly into rest-only signatures (#52838) 2023-03-02 09:09:54 -08:00
Wesley Wigham 958487beda Mark indexed access object type comparisons as unreliable (#52106) 2023-03-01 13:07:44 -08:00
Mateusz Burzyński fc756ebc17 Use missingType instead of undefinedType for optional methods under exactOptionalPropertyTypes (#52519) 2023-03-01 11:25:39 -08:00
Mateusz Burzyński 080f9c1c3f Fixed false positive errors in empty optional binding patterns in declaration signatures (#50816) 2023-03-01 10:58:37 -08:00