4181 Commits

Author SHA1 Message Date
Anders Hejlsberg
f8b3ea7972
Propagate errorType in getConditionalType (#53801) 2023-04-16 16:15:55 -07:00
Anders Hejlsberg
e49db97f97
Exclude parameters of non-inferrable signatures from inference (#53756) 2023-04-14 12:44:37 -07:00
Sebastian Silbermann
b92483f20c
RFC: Consult new JSX.ElementType for valid JSX element types (#51328)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2023-04-14 10:54:02 -07:00
Josh Goldberg ✨
0023505dc7
Removed unnecessary use-before-define error for const enums (#53625) 2023-04-12 13:38:29 -07:00
Gabriela Araujo Britto
2db688e36f
Reset type resolution stack when starting to compute variance (#53549) 2023-04-11 14:05:31 -07:00
Luca Pizzini
af5e8e2e4e
fix(lib.d.ts): fixed buffer parameter type of DataView (#53130) 2023-04-11 08:19:25 -07:00
Nicolas Rodriguez
7b2b6a8cc2
fix(19577): fix regression with fully inferred types and non-null assertions (#50092) 2023-04-10 17:32:56 -07:00
Ryan Cavanaugh
c89f87f66a
Detect malformed UTF-8 files and refuse to engage further (#53667) 2023-04-07 12:51:47 -07:00
Jake Bailey
7f6376794e
Reuse operandType in checkPrefixUnaryExpression (#53682) 2023-04-06 13:37:12 -07:00
Jake Bailey
f243b987af
Fix crash in parseJsxChild found by fuzzing (#53674) 2023-04-05 13:47:02 -07:00
Jake Bailey
bebb6d0086
Disable JSX recovery hack when in unary expression context (#53666) 2023-04-05 13:04:37 -07:00
Jake Bailey
a720ba921f
Fix crash when private id in array assignment (#53665) 2023-04-05 13:04:13 -07:00
Anders Hejlsberg
b40385b595
Explicit undefined return type checked similar to explicit void return type (#53607) 2023-04-01 14:44:52 -07:00
Andrew Branch
5586727193
Allow getter and setter types to be unrelated (#53417) 2023-03-30 08:51:01 -07:00
Maria José Solano
c5b288487a
Don't error when function has an implicit return but its return type is assignable to undefined (#53490) 2023-03-27 13:21:07 -07:00
Oleksandr T
437fd059be
fix(53257): Illegal .d.ts class property definition for "constructor" generated from JavaScript (#53266) 2023-03-27 11:32:10 -07:00
形素叢集・ぐらふぃーむ
c2dc2fd9b9
fix(396): (Dis)allow Octal and Bad Escape Sequences in String and (Tagged) Template Literals (#51837) 2023-03-24 16:15:50 -07:00
Jake Bailey
9bd1a3225b
Revert PR #53255 (#53464) 2023-03-23 12:52:05 -07:00
Gabriela Araujo Britto
89478254c8
Defer type comparability check for assertions (#53261) 2023-03-23 11:46:42 -07:00
Anders Hejlsberg
511921e1e2
Improve detection of cases where subtype reduction is unnecessary (#53435) 2023-03-23 07:09:12 -07:00
Anders Hejlsberg
37bafa539c
Exclude comparable relation from literal type relation optimization (#53419) 2023-03-23 07:04:16 -07:00
Anders Hejlsberg
25550bd3d6
Exclude special index signature rule from strict subtype relation (#53388)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2023-03-23 07:03:09 -07:00
Andrew Branch
7009c76d00
Support wildcard exports in tsconfig lookup (#53443) 2023-03-22 15:21:50 -07:00
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