Skip to content

Fix getEffectiveCheckNode - #60309

Merged
Gabriela Araujo Britto (gabritto) merged 1 commit into
mainfrom
gabritto/fixEffectiveNode
Nov 6, 2024
Merged

Fix getEffectiveCheckNode#60309
Gabriela Araujo Britto (gabritto) merged 1 commit into
mainfrom
gabritto/fixEffectiveNode

Conversation

@gabritto

@gabrittoGabriela Araujo Britto (gabritto) commented Oct 22, 2024

Copy link
Copy Markdown
Member

getEffectiveCheckNode is currently used to adjust error position by skipping outer expressions of a node.
This fixes the following problems in error position related to usage of getEffectiveCheckNode.

Nested satisfies are not skipped:

((): {a: true}=>(({})satisfiesunknown)satisfiesunknown)();// Error on `satisfies`, should be on `{}`

Playground

In JS files, JSDoc type assertions are skipped:

/** * @template T * @param {T|undefined} value value or not * @returns {T} result value */constfoo1=value=>/** @type {string} */({ ...value});// Error on `{ ...value }`, should be on `({ ...value })`. Small difference./** * @template T * @param {T|undefined} value value or not * @returns {T} result value */constfoo2=value=>/** @type {string} */(/** @type {T} */({ ...value}));// Error on `{ ...value }`, should be on `(/** @type {T} */({ ...value }))`, which is closer to the cast.

Playground

Found those problems when working on another PR.

@typescript-bot

Copy link
Copy Markdown
Contributor

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure Daniel Rosenwasser (@DanielRosenwasser) and Ryan Cavanaugh (@RyanCavanaugh) are aware of the changes, just as a heads up.

@gabritto

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Oct 22, 2024

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
test top400✅ Started✅ Results
user test this✅ Started✅ Results
run dt✅ Started✅ Results
perf test this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Gabriela Araujo Britto (@gabritto) Here are the results of running the user tests with tsc comparing main and refs/pull/60309/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Gabriela Araujo Britto (@gabritto), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Gabriela Araujo Britto (@gabritto)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3131~~~p=1.000 n=6
Symbols62,34062,340~~~p=1.000 n=6
Types50,37950,379~~~p=1.000 n=6
Memory used194,017k (± 0.92%)193,993k (± 0.93%)~192,803k196,348kp=0.810 n=6
Parse Time1.31s (± 1.01%)1.32s (± 0.62%)~1.31s1.33sp=0.546 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.75s (± 0.33%)9.74s (± 0.24%)~9.70s9.77sp=0.517 n=6
Emit Time2.73s (± 0.55%)2.73s (± 0.46%)~2.71s2.74sp=0.607 n=6
Total Time14.51s (± 0.26%)14.51s (± 0.16%)~14.47s14.53sp=0.371 n=6
angular-1 - node (v18.15.0, x64)
Errors3333~~~p=1.000 n=6
Symbols947,886947,886~~~p=1.000 n=6
Types410,840410,840~~~p=1.000 n=6
Memory used1,224,586k (± 0.00%)1,224,627k (± 0.00%)~1,224,548k1,224,719kp=0.378 n=6
Parse Time6.66s (± 1.02%)6.62s (± 0.65%)~6.58s6.69sp=0.295 n=6
Bind Time1.88s (± 0.29%)1.88s (± 0.34%)~1.87s1.89sp=0.201 n=6
Check Time31.81s (± 0.34%)31.88s (± 0.22%)~31.79s31.97sp=0.170 n=6
Emit Time15.11s (± 0.27%)15.14s (± 0.24%)~15.09s15.18sp=0.228 n=6
Total Time55.48s (± 0.18%)55.52s (± 0.09%)~55.45s55.58sp=0.521 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,494,3732,494,373~~~p=1.000 n=6
Types908,290908,290~~~p=1.000 n=6
Memory used2,306,658k (± 0.00%)2,306,709k (± 0.00%)+50k (+ 0.00%)2,306,648k2,306,739kp=0.020 n=6
Parse Time9.32s (± 0.21%)9.29s (± 0.26%)~9.25s9.32sp=0.052 n=6
Bind Time2.15s (± 0.70%)2.15s (± 0.62%)~2.13s2.17sp=0.931 n=6
Check Time74.91s (± 0.38%)74.95s (± 0.41%)~74.54s75.33sp=0.873 n=6
Emit Time0.29s (± 1.41%)0.28s (± 3.04%)🟩-0.01s (- 4.62%)0.27s0.29sp=0.018 n=6
Total Time86.67s (± 0.33%)86.67s (± 0.34%)~86.27s86.99sp=1.000 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,258,0331,258,045+12 (+ 0.00%)~~p=0.001 n=6
Types266,263266,265+2 (+ 0.00%)~~p=0.001 n=6
Memory used3,146,670k (± 0.02%)3,146,670k (± 0.02%)~3,145,713k3,147,321kp=1.000 n=6
Parse Time6.61s (± 1.16%)6.55s (± 0.98%)~6.48s6.67sp=0.128 n=6
Bind Time2.29s (± 4.17%)2.30s (± 1.23%)~2.26s2.34sp=0.334 n=6
Check Time42.95s (± 0.49%)43.01s (± 0.41%)~42.82s43.28sp=0.936 n=6
Emit Time3.53s (± 1.59%)3.49s (± 1.57%)~3.40s3.57sp=0.336 n=6
Total Time55.39s (± 0.45%)55.35s (± 0.27%)~55.20s55.55sp=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,258,0331,258,045+12 (+ 0.00%)~~p=0.001 n=6
Types266,263266,265+2 (+ 0.00%)~~p=0.001 n=6
Memory used2,496,444k (± 0.02%)2,496,333k (± 0.01%)~2,496,156k2,496,554kp=0.689 n=6
Parse Time5.42s (± 0.40%)5.37s (± 0.52%)-0.05s (- 0.95%)5.33s5.40sp=0.013 n=6
Bind Time1.74s (± 0.30%)1.73s (± 0.47%)~1.72s1.74sp=0.523 n=6
Check Time35.85s (± 0.18%)35.86s (± 0.17%)~35.77s35.92sp=0.810 n=6
Emit Time3.04s (± 1.94%)3.07s (± 0.93%)~3.04s3.12sp=0.191 n=6
Total Time46.04s (± 0.10%)46.03s (± 0.15%)~45.93s46.10sp=0.809 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols261,789261,790+1 (+ 0.00%)~~p=0.001 n=6
Types106,511106,513+2 (+ 0.00%)~~p=0.001 n=6
Memory used438,830k (± 0.01%)438,817k (± 0.01%)~438,726k438,873kp=1.000 n=6
Parse Time3.54s (± 0.94%)3.54s (± 0.64%)~3.50s3.56sp=0.936 n=6
Bind Time1.32s (± 1.35%)1.32s (± 0.92%)~1.31s1.34sp=0.864 n=6
Check Time18.93s (± 0.36%)18.97s (± 0.34%)~18.87s19.03sp=0.295 n=6
Emit Time1.54s (± 1.09%)1.54s (± 0.54%)~1.53s1.55sp=0.621 n=6
Total Time25.33s (± 0.29%)25.35s (± 0.22%)~25.27s25.43sp=0.688 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors6868~~~p=1.000 n=6
Symbols225,919225,919~~~p=1.000 n=6
Types94,41594,415~~~p=1.000 n=6
Memory used371,070k (± 0.00%)371,086k (± 0.01%)~371,035k371,160kp=0.520 n=6
Parse Time2.91s (± 1.03%)2.90s (± 0.60%)~2.87s2.92sp=0.627 n=6
Bind Time1.58s (± 1.86%)1.60s (± 1.16%)~1.58s1.62sp=0.120 n=6
Check Time16.39s (± 0.32%)16.39s (± 0.52%)~16.24s16.47sp=0.872 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.88s (± 0.31%)20.89s (± 0.49%)~20.72s20.99sp=0.748 n=6
vscode - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols3,124,5543,124,554~~~p=1.000 n=6
Types1,077,0731,077,073~~~p=1.000 n=6
Memory used3,217,541k (± 0.01%)3,217,368k (± 0.01%)~3,216,782k3,217,898kp=0.810 n=6
Parse Time14.07s (± 0.23%)14.10s (± 0.31%)~14.02s14.14sp=0.147 n=6
Bind Time4.46s (± 0.31%)4.48s (± 0.46%)+0.03s (+ 0.60%)4.46s4.51sp=0.043 n=6
Check Time87.07s (± 2.24%)85.88s (± 1.88%)~84.02s87.99sp=0.261 n=6
Emit Time26.29s (± 6.60%)26.61s (± 3.57%)~25.21s27.49sp=0.378 n=6
Total Time131.89s (± 1.64%)131.09s (± 1.68%)~129.04s133.78sp=0.423 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols286,375286,375~~~p=1.000 n=6
Types116,078116,078~~~p=1.000 n=6
Memory used437,158k (± 0.02%)437,035k (± 0.02%)~436,907k437,156kp=0.066 n=6
Parse Time5.05s (± 0.24%)5.09s (± 0.44%)+0.05s (+ 0.96%)5.06s5.11sp=0.003 n=6
Bind Time2.18s (± 1.02%)2.15s (± 1.31%)~2.12s2.19sp=0.051 n=6
Check Time22.90s (± 0.46%)23.02s (± 1.21%)~22.84s23.58sp=0.520 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time30.13s (± 0.41%)30.26s (± 0.98%)~30.04s30.85sp=0.419 n=6
xstate-main - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols543,130543,130~~~p=1.000 n=6
Types181,889181,889~~~p=1.000 n=6
Memory used485,534k (± 0.01%)485,547k (± 0.02%)~485,448k485,673kp=0.936 n=6
Parse Time4.17s (± 0.47%)4.18s (± 0.36%)~4.16s4.20sp=0.607 n=6
Bind Time1.45s (± 1.38%)1.46s (± 0.93%)~1.45s1.48sp=0.437 n=6
Check Time23.69s (± 0.43%)23.75s (± 0.19%)~23.69s23.80sp=0.173 n=6
Emit Time0.00s (±244.70%)0.00s (±244.70%)~0.00s0.01sp=1.000 n=6
Total Time29.31s (± 0.36%)29.38s (± 0.21%)~29.32s29.46sp=0.065 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Gabriela Araujo Britto (@gabritto) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60309/merge:

Everything looks good!

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@gabritto@typescript-bot@sandersn@andrewbranch