Skip to content

Conversation

@Andarist
Copy link
Contributor

@Andarist Andarist commented Oct 2, 2024

fixes #60119
fixes #60179

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Oct 2, 2024
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 2, 2024

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

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

Comment on lines 15 to +19
const { p1 } = f(); // error
~~
!!! error TS2339: Property 'p1' does not exist on type 'unknown'.
~~~
!!! error TS2571: Object is of type 'unknown'.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets a little bit noisy because we essentially report the same problem twice.

There are cases in the changed baselines that require the error to be reported on the initializer, like here:

var [a0, a1]: any = undefined;
~~~~~~~~~
!!! error TS18050: The value 'undefined' cannot be used here.
var [a2 = false, a3 = 1]: any = undefined;
~~~~~~~~~
!!! error TS18050: The value 'undefined' cannot be used here.

So if there is desire to limit the amount of reported errors I think it would be good to report consistently them on the initializer at all times. I think handling this differently for different kind of patterns will complicate the code. But if there is a strong belief that this would provide a better DX - I can implement the required changes.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60121/merge:

Something interesting changed - please have a look.

Details

effect

tsconfig.json

tsconfig.base.json

webpack

tsconfig.types.json

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 31 31 ~ ~ ~ p=1.000 n=6
Symbols 62,340 62,340 ~ ~ ~ p=1.000 n=6
Types 50,379 50,379 ~ ~ ~ p=1.000 n=6
Memory used 194,014k (± 0.96%) 194,095k (± 0.92%) ~ 192,798k 196,403k p=0.748 n=6
Parse Time 1.31s (± 0.89%) 1.32s (± 0.39%) ~ 1.31s 1.32s p=0.523 n=6
Bind Time 0.72s 0.72s ~ ~ ~ p=1.000 n=6
Check Time 9.77s (± 0.34%) 9.77s (± 0.34%) ~ 9.74s 9.83s p=0.687 n=6
Emit Time 2.71s (± 0.80%) 2.73s (± 0.43%) ~ 2.71s 2.74s p=0.061 n=6
Total Time 14.51s (± 0.26%) 14.53s (± 0.27%) ~ 14.49s 14.60s p=0.334 n=6
angular-1 - node (v18.15.0, x64)
Errors 33 33 ~ ~ ~ p=1.000 n=6
Symbols 947,886 947,895 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 410,840 410,860 +20 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,224,784k (± 0.00%) 1,224,805k (± 0.01%) ~ 1,224,703k 1,224,851k p=0.575 n=6
Parse Time 8.07s (± 0.94%) 8.10s (± 1.18%) ~ 7.97s 8.21s p=0.748 n=6
Bind Time 2.28s (± 0.58%) 2.27s (± 0.95%) ~ 2.24s 2.30s p=0.318 n=6
Check Time 37.85s (± 0.43%) 37.92s (± 0.42%) ~ 37.69s 38.09s p=0.336 n=6
Emit Time 18.25s (± 0.92%) 18.36s (± 0.50%) ~ 18.20s 18.45s p=0.199 n=6
Total Time 66.45s (± 0.54%) 66.64s (± 0.27%) ~ 66.45s 66.91s p=0.377 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,536,010 2,536,093 +83 (+ 0.00%) ~ ~ p=0.001 n=6
Types 935,586 935,648 +62 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,369,009k (± 0.00%) 2,368,978k (± 0.00%) ~ 2,368,924k 2,369,046k p=0.378 n=6
Parse Time 9.47s (± 0.18%) 9.46s (± 0.28%) ~ 9.43s 9.50s p=0.570 n=6
Bind Time 2.20s (± 0.74%) 2.20s (± 0.34%) ~ 2.19s 2.21s p=1.000 n=6
Check Time 76.17s (± 0.48%) 76.19s (± 0.25%) ~ 75.92s 76.37s p=0.936 n=6
Emit Time 0.28s (± 1.82%) 0.28s (± 1.86%) ~ 0.27s 0.28s p=0.069 n=6
Total Time 88.12s (± 0.42%) 88.13s (± 0.23%) ~ 87.85s 88.32s p=0.873 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,106 1,258,161 +55 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,266 266,303 +37 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 3,146,859k (± 0.02%) 3,146,506k (± 0.04%) ~ 3,144,963k 3,148,426k p=0.575 n=6
Parse Time 6.61s (± 1.50%) 6.59s (± 0.43%) ~ 6.54s 6.62s p=0.810 n=6
Bind Time 2.29s (± 3.78%) 2.33s (± 1.20%) ~ 2.30s 2.37s p=0.747 n=6
Check Time 42.93s (± 0.43%) 43.05s (± 0.34%) ~ 42.83s 43.25s p=0.298 n=6
Emit Time 3.50s (± 2.16%) 3.55s (± 1.51%) ~ 3.50s 3.62s p=0.229 n=6
Total Time 55.34s (± 0.38%) 55.52s (± 0.34%) ~ 55.27s 55.75s p=0.128 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,106 1,258,161 +55 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,266 266,303 +37 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,858,610k (±13.76%) 2,644,804k (±10.88%) ~ 2,497,042k 3,218,356k p=0.378 n=6
Parse Time 6.72s (± 2.82%) 6.61s (± 2.67%) ~ 6.47s 6.95s p=0.423 n=6
Bind Time 2.15s (± 1.05%) 2.15s (± 1.46%) ~ 2.09s 2.17s p=0.573 n=6
Check Time 43.14s (± 0.20%) 43.04s (± 0.41%) ~ 42.77s 43.19s p=0.689 n=6
Emit Time 3.57s (± 3.98%) 3.58s (± 4.84%) ~ 3.39s 3.88s p=0.936 n=6
Total Time 55.58s (± 0.54%) 55.39s (± 0.52%) ~ 55.08s 55.81s p=0.230 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 261,785 261,785 ~ ~ ~ p=1.000 n=6
Types 106,508 106,509 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 438,754k (± 0.01%) 438,709k (± 0.01%) ~ 438,654k 438,748k p=0.065 n=6
Parse Time 4.40s (± 1.67%) 4.38s (± 1.24%) ~ 4.33s 4.48s p=0.748 n=6
Bind Time 1.62s (± 0.99%) 1.62s (± 0.64%) ~ 1.61s 1.63s p=0.652 n=6
Check Time 23.43s (± 0.44%) 23.45s (± 0.44%) ~ 23.33s 23.60s p=1.000 n=6
Emit Time 1.92s (± 1.36%) 1.91s (± 1.22%) ~ 1.88s 1.95s p=0.935 n=6
Total Time 31.38s (± 0.39%) 31.36s (± 0.36%) ~ 31.21s 31.45s p=0.872 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 68 ~ ~ ~ p=1.000 n=6
Symbols 225,919 225,920 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 94,415 94,416 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 371,116k (± 0.02%) 371,065k (± 0.02%) ~ 370,949k 371,164k p=0.261 n=6
Parse Time 2.91s (± 0.67%) 2.88s (± 0.83%) -0.03s (- 1.14%) 2.85s 2.92s p=0.041 n=6
Bind Time 1.59s (± 1.67%) 1.58s (± 1.04%) ~ 1.56s 1.61s p=0.742 n=6
Check Time 16.36s (± 0.37%) 16.40s (± 0.41%) ~ 16.33s 16.47s p=0.297 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.87s (± 0.28%) 20.86s (± 0.40%) ~ 20.78s 20.96s p=0.872 n=6
vscode - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 3,111,184 3,111,311 +127 (+ 0.00%) ~ ~ p=0.001 n=6
Types 1,072,447 1,072,510 +63 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 3,203,433k (± 0.00%) 3,203,525k (± 0.00%) ~ 3,203,474k 3,203,584k p=0.199 n=6
Parse Time 11.49s (± 0.31%) 11.47s (± 0.38%) ~ 11.40s 11.51s p=1.000 n=6
Bind Time 3.72s (± 2.18%) 3.69s (± 0.32%) ~ 3.67s 3.70s p=0.742 n=6
Check Time 71.96s (± 0.37%) 72.10s (± 0.37%) ~ 71.87s 72.59s p=0.630 n=6
Emit Time 20.89s (± 9.74%) 19.00s (± 0.26%) ~ 18.94s 19.08s p=0.148 n=6
Total Time 108.05s (± 1.87%) 106.27s (± 0.25%) ~ 106.06s 106.76s p=0.173 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 285,146 285,179 +33 (+ 0.01%) ~ ~ p=0.001 n=6
Types 115,776 115,799 +23 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 434,952k (± 0.02%) 435,025k (± 0.03%) ~ 434,818k 435,133k p=0.298 n=6
Parse Time 5.02s (± 1.05%) 5.03s (± 0.79%) ~ 4.98s 5.07s p=0.936 n=6
Bind Time 2.15s (± 0.72%) 2.15s (± 1.01%) ~ 2.11s 2.17s p=0.934 n=6
Check Time 22.71s (± 0.31%) 22.72s (± 0.37%) ~ 22.64s 22.86s p=1.000 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 29.87s (± 0.30%) 29.89s (± 0.31%) ~ 29.80s 30.06s p=0.810 n=6
xstate-main - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 540,222 540,231 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 181,145 181,158 +13 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 483,877k (± 0.01%) 483,797k (± 0.03%) ~ 483,485k 483,914k p=0.471 n=6
Parse Time 3.36s (± 0.72%) 3.32s (± 1.00%) ~ 3.29s 3.38s p=0.053 n=6
Bind Time 1.17s (± 2.14%) 1.18s (± 1.36%) ~ 1.16s 1.20s p=0.505 n=6
Check Time 19.10s (± 0.26%) 19.25s (± 1.95%) ~ 19.00s 20.01s p=0.627 n=6
Emit Time 0.00s (±244.70%) 0.00s ~ ~ ~ p=0.405 n=6
Total Time 23.62s (± 0.10%) 23.75s (± 1.69%) ~ 23.51s 24.56s p=1.000 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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60121/merge:

Everything looks good!

Copy link
Contributor

@benjaminjkraft benjaminjkraft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, thanks! I'm not competent to review the code but I took a glance at the tests.

Does this work right if it's deeper inside the restructuring? The actual code that led to this is more like

const { f: { [k]: v } } = /* value that could be `{ f: undefined }` */

(Maybe if you know the code better it obviously does handle this, but my quick glance made me think it might not.)

@Andarist
Copy link
Contributor Author

Andarist commented Oct 3, 2024

@benjaminjkraft good catch, this wasn't handled - I just pushed out a fix for this.

@jakebailey could you rerun tests? the webpack break seems to be OK but the Effect's one is fishy - if you could build a playground for me that would help me with bisecting their repo to a repro case

@jakebailey
Copy link
Member

@typescript-bot test it
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 3, 2024

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

Command Status Results
pack this ✅ Started ✅ Results
test top400 ✅ Started ✅ Results
user test this ✅ Started 👀 Results
run dt ✅ Started 👀 Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 3, 2024

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/163814/artifacts?artifactName=tgz&fileId=7FE7AC80556989344546EFD4716E142AAE06D32339E212E84B5B3C6755D5EA0502&fileName=/typescript-5.7.0-insiders.20241003.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.7.0-pr-60121-9".;

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60121/merge:

Something interesting changed - please have a look.

Details

effect

tsconfig.json

tsconfig.base.json

webpack

tsconfig.types.json

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: openfin
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/openfin/_v2/api/view/view.d.ts
  187:11  error  TypeScript@local compile error: 
Object is possibly 'undefined'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.23_typescript@5.7.0-dev.20241002/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.23_typescript@5.7.0-dev.20241002/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

You can check the log here.

@Andarist
Copy link
Contributor Author

Andarist commented Oct 3, 2024

DT break comes from a declaration like this:

export declare function focus({
  emitSynthFocused,
}?: {
  emitSynthFocused: boolean;
}): Promise<void>;

that can be legally emitted from (TS playground):

export async function focus(
  {
    emitSynthFocused,
  }: {
    emitSynthFocused: boolean;
  } = { emitSynthFocused: true },
) {}

I'll have to ignore this check for declaration nodes

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 31 31 ~ ~ ~ p=1.000 n=6
Symbols 62,340 62,340 ~ ~ ~ p=1.000 n=6
Types 50,379 50,379 ~ ~ ~ p=1.000 n=6
Memory used 193,474k (± 0.76%) 193,436k (± 0.80%) ~ 192,784k 196,587k p=0.521 n=6
Parse Time 1.32s (± 0.89%) 1.30s (± 0.58%) -0.02s (- 1.26%) 1.29s 1.31s p=0.032 n=6
Bind Time 0.72s 0.72s (± 0.57%) ~ 0.72s 0.73s p=0.405 n=6
Check Time 9.76s (± 0.42%) 9.74s (± 0.41%) ~ 9.67s 9.77s p=0.406 n=6
Emit Time 2.73s (± 0.60%) 2.73s (± 1.25%) ~ 2.68s 2.77s p=1.000 n=6
Total Time 14.52s (± 0.34%) 14.50s (± 0.37%) ~ 14.44s 14.56s p=0.628 n=6
angular-1 - node (v18.15.0, x64)
Errors 33 33 ~ ~ ~ p=1.000 n=6
Symbols 947,886 947,895 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 410,840 410,860 +20 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,224,591k (± 0.00%) 1,224,538k (± 0.00%) -53k (- 0.00%) 1,224,510k 1,224,573k p=0.013 n=6
Parse Time 6.65s (± 0.72%) 6.66s (± 0.56%) ~ 6.60s 6.71s p=1.000 n=6
Bind Time 1.88s (± 0.27%) 1.89s (± 0.64%) ~ 1.88s 1.91s p=0.923 n=6
Check Time 31.70s (± 0.41%) 31.80s (± 0.38%) ~ 31.59s 31.93s p=0.128 n=6
Emit Time 15.18s (± 0.74%) 15.14s (± 0.35%) ~ 15.06s 15.21s p=0.935 n=6
Total Time 55.41s (± 0.30%) 55.49s (± 0.26%) ~ 55.25s 55.69s p=0.575 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,536,010 2,536,093 +83 (+ 0.00%) ~ ~ p=0.001 n=6
Types 935,586 935,648 +62 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,368,951k (± 0.00%) 2,368,999k (± 0.00%) ~ 2,368,945k 2,369,041k p=0.173 n=6
Parse Time 9.48s (± 0.16%) 9.49s (± 0.32%) ~ 9.44s 9.52s p=0.414 n=6
Bind Time 2.19s (± 0.48%) 2.20s (± 0.38%) ~ 2.18s 2.20s p=1.000 n=6
Check Time 76.42s (± 0.21%) 76.02s (± 0.40%) -0.39s (- 0.51%) 75.61s 76.36s p=0.031 n=6
Emit Time 0.28s (± 2.26%) 0.28s (± 1.47%) ~ 0.27s 0.28s p=0.673 n=6
Total Time 88.37s (± 0.20%) 87.99s (± 0.35%) -0.38s (- 0.43%) 87.57s 88.34s p=0.045 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,106 1,258,162 +56 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,266 266,306 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 3,146,554k (± 0.03%) 3,146,707k (± 0.04%) ~ 3,145,017k 3,148,842k p=0.936 n=6
Parse Time 6.59s (± 0.71%) 6.61s (± 0.53%) ~ 6.57s 6.66s p=0.423 n=6
Bind Time 2.29s (± 4.79%) 2.35s (± 0.69%) ~ 2.33s 2.38s p=0.121 n=6
Check Time 42.98s (± 0.39%) 42.98s (± 0.41%) ~ 42.75s 43.21s p=0.936 n=6
Emit Time 3.54s (± 1.43%) 3.49s (± 1.34%) ~ 3.44s 3.55s p=0.078 n=6
Total Time 55.40s (± 0.32%) 55.45s (± 0.29%) ~ 55.29s 55.64s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,106 1,258,162 +56 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,266 266,306 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,765,879k (±12.87%) 2,619,223k (±11.19%) ~ 2,498,519k 3,218,092k p=0.173 n=6
Parse Time 6.66s (± 2.55%) 6.57s (± 1.87%) ~ 6.41s 6.78s p=0.471 n=6
Bind Time 2.15s (± 0.99%) 2.13s (± 1.63%) ~ 2.09s 2.17s p=0.466 n=6
Check Time 43.02s (± 0.58%) 43.21s (± 0.38%) ~ 43.07s 43.47s p=0.298 n=6
Emit Time 3.55s (± 3.16%) 3.53s (± 4.36%) ~ 3.40s 3.81s p=0.575 n=6
Total Time 55.36s (± 0.57%) 55.44s (± 0.60%) ~ 55.08s 56.00s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 261,785 261,786 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,508 106,512 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 438,493k (± 0.01%) 438,533k (± 0.01%) ~ 438,471k 438,595k p=0.128 n=6
Parse Time 2.89s (± 0.61%) 2.89s (± 0.67%) ~ 2.86s 2.92s p=0.623 n=6
Bind Time 1.10s 1.10s (± 0.37%) ~ 1.09s 1.10s p=0.405 n=6
Check Time 15.70s (± 0.31%) 15.74s (± 0.39%) ~ 15.67s 15.83s p=0.332 n=6
Emit Time 1.30s (± 1.86%) 1.31s (± 2.13%) ~ 1.27s 1.34s p=0.809 n=6
Total Time 20.99s (± 0.31%) 21.04s (± 0.26%) ~ 20.98s 21.11s p=0.293 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 68 ~ ~ ~ p=1.000 n=6
Symbols 225,919 225,920 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 94,415 94,416 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 371,105k (± 0.02%) 371,069k (± 0.03%) ~ 370,989k 371,261k p=0.173 n=6
Parse Time 2.90s (± 1.08%) 2.89s (± 1.14%) ~ 2.85s 2.93s p=0.747 n=6
Bind Time 1.59s (± 1.59%) 1.59s (± 1.08%) ~ 1.57s 1.62s p=0.935 n=6
Check Time 16.34s (± 0.44%) 16.37s (± 0.37%) ~ 16.31s 16.44s p=0.377 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.83s (± 0.52%) 20.85s (± 0.29%) ~ 20.80s 20.95s p=0.468 n=6
vscode - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 3,111,051 3,111,178 +127 (+ 0.00%) ~ ~ p=0.001 n=6
Types 1,072,475 1,072,538 +63 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 3,203,246k (± 0.01%) 3,203,493k (± 0.00%) ~ 3,203,384k 3,203,631k p=0.230 n=6
Parse Time 14.00s (± 0.55%) 14.07s (± 0.37%) ~ 14.00s 14.13s p=0.127 n=6
Bind Time 4.43s (± 0.86%) 4.46s (± 2.35%) ~ 4.39s 4.67s p=1.000 n=6
Check Time 85.38s (± 1.43%) 87.65s (± 3.09%) ~ 84.51s 91.98s p=0.173 n=6
Emit Time 24.97s (± 9.13%) 25.68s (± 8.82%) ~ 22.68s 27.29s p=0.471 n=6
Total Time 128.79s (± 2.24%) 131.86s (± 2.45%) ~ 126.08s 134.41s p=0.093 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 285,146 285,179 +33 (+ 0.01%) ~ ~ p=0.001 n=6
Types 115,776 115,799 +23 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 434,814k (± 0.06%) 435,024k (± 0.03%) ~ 434,833k 435,214k p=0.078 n=6
Parse Time 5.02s (± 0.97%) 5.02s (± 0.90%) ~ 4.98s 5.08s p=0.936 n=6
Bind Time 2.14s (± 1.34%) 2.15s (± 1.08%) ~ 2.12s 2.18s p=0.373 n=6
Check Time 22.99s (± 2.52%) 22.77s (± 0.72%) ~ 22.60s 23.02s p=0.748 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 30.16s (± 1.81%) 29.95s (± 0.51%) ~ 29.77s 30.15s p=0.810 n=6
xstate-main - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 540,222 540,231 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 181,145 181,158 +13 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 483,836k (± 0.02%) 483,919k (± 0.01%) ~ 483,863k 483,982k p=0.128 n=6
Parse Time 4.18s (± 0.73%) 4.17s (± 0.84%) ~ 4.13s 4.21s p=0.809 n=6
Bind Time 1.45s (± 1.03%) 1.46s (± 0.75%) ~ 1.45s 1.48s p=0.279 n=6
Check Time 23.77s (± 1.11%) 23.64s (± 0.50%) ~ 23.44s 23.76s p=0.688 n=6
Emit Time 0.01s (±109.43%) 0.01s (±109.43%) ~ 0.00s 0.01s p=1.000 n=6
Total Time 29.40s (± 0.86%) 29.28s (± 0.43%) ~ 29.08s 29.43s p=0.378 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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@Andarist
Copy link
Contributor Author

Andarist commented Oct 3, 2024

Effect's break is spooky. I can't repro it in the IDE, I can't repro it by running tsc in their repo and I can't repro it in the playground

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60121/merge:

Everything looks good!

Copilot AI review requested due to automatic review settings August 23, 2025 22:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses destructuring errors with nullable initializers by implementing proper null checking for destructured parameters and values. The fix ensures that destructuring patterns with potentially null or undefined values generate appropriate error messages.

Key Changes:

  • Adds null checking for destructuring patterns when no default initializer is provided
  • Replaces expression checking with explicit non-null expression checking for destructuring initializers
  • Updates error handling to provide specific nullable error messages (TS18047, TS18048, TS18049, TS18050)

Reviewed Changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.

File Description
src/compiler/checker.ts Core implementation that adds null checking for binding element parents and non-null expression checking for destructuring initializers
tests/cases/conformance/es6/destructuring/bindingPatternWithNullableInitializer*.ts New test cases covering destructuring with nullable types including undefined, null, and union types
tests/baselines/reference/*.errors.txt Updated baseline files showing new error messages for destructuring nullable values

@Andarist
Copy link
Contributor Author

@jakebailey, could you run the tests and build the playground for this again?

@jakebailey
Copy link
Member

@typescript-bot test it
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 23, 2025

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

Command Status Results
pack this ✅ Started ✅ Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started 👀 Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 23, 2025

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/165941/artifacts?artifactName=tgz&fileId=A1504A49452BBFBFA8CDA1C322D6F121B4FA8EAF9737C21F605184276F700A5F02&fileName=/typescript-6.0.0-insiders.20250823.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@6.0.0-pr-60121-19".;

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: openfin
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/openfin/_v2/api/view/view.d.ts
  187:11  error  TypeScript@local compile error: 
Object is possibly 'undefined'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.33_typescript@6.0.0-dev.20250823/node_modules/@definitelytyped/dtslint/dist/index.js:199:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.33_typescript@6.0.0-dev.20250823/node_modules/@definitelytyped/dtslint/dist/index.js:191:20)

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60121/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Git clone failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,370 62,370 ~ ~ ~ p=1.000 n=6
Types 50,386 50,386 ~ ~ ~ p=1.000 n=6
Memory used 195,953k (± 0.77%) 194,680k (± 1.10%) ~ 192,634k 196,777k p=0.298 n=6
Parse Time 1.62s (± 0.85%) 1.59s (± 2.23%) ~ 1.53s 1.63s p=0.323 n=6
Bind Time 0.87s (± 1.13%) 0.88s (± 0.86%) ~ 0.87s 0.89s p=0.300 n=6
Check Time 11.76s (± 0.34%) 11.74s (± 0.43%) ~ 11.66s 11.80s p=0.575 n=6
Emit Time 3.37s (± 3.60%) 3.42s (± 4.88%) ~ 3.25s 3.59s p=1.000 n=6
Total Time 17.61s (± 0.86%) 17.63s (± 0.58%) ~ 17.51s 17.74s p=0.687 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 948,914 948,923 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 410,884 410,904 +20 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,226,364k (± 0.00%) 1,226,365k (± 0.00%) ~ 1,226,320k 1,226,437k p=0.810 n=6
Parse Time 6.52s (± 0.82%) 6.51s (± 0.69%) ~ 6.47s 6.59s p=0.808 n=6
Bind Time 1.87s (± 0.28%) 1.87s (± 0.28%) ~ 1.87s 1.88s p=1.000 n=6
Check Time 32.00s (± 0.25%) 32.04s (± 0.16%) ~ 31.97s 32.11s p=0.336 n=6
Emit Time 14.78s (± 0.35%) 14.80s (± 0.75%) ~ 14.68s 14.97s p=0.936 n=6
Total Time 55.16s (± 0.15%) 55.22s (± 0.21%) ~ 55.03s 55.36s p=0.332 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,545,789 2,545,876 +87 (+ 0.00%) ~ ~ p=0.001 n=6
Types 902,473 902,541 +68 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,830,729k (± 0.00%) 2,830,711k (± 0.01%) ~ 2,830,508k 2,830,842k p=0.810 n=6
Parse Time 8.75s (± 0.28%) 8.77s (± 0.34%) ~ 8.74s 8.81s p=0.191 n=6
Bind Time 2.23s (± 0.49%) 2.22s (± 0.34%) ~ 2.21s 2.23s p=0.195 n=6
Check Time 86.38s (± 0.71%) 86.62s (± 1.57%) ~ 85.65s 88.47s p=0.378 n=6
Emit Time 0.62s (±125.04%) 0.30s (± 1.70%) ~ 0.30s 0.31s p=0.523 n=6
Total Time 97.99s (± 0.75%) 97.92s (± 1.37%) ~ 96.96s 99.75s p=0.378 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,236,880 1,236,936 +56 (+ 0.00%) ~ ~ p=0.001 n=6
Types 259,624 259,664 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,629,187k (±14.25%) 2,508,147k (±11.80%) ~ 2,386,367k 3,113,119k p=0.471 n=6
Parse Time 5.22s (± 1.91%) 5.19s (± 1.36%) ~ 5.13s 5.33s p=0.748 n=6
Bind Time 1.80s (± 1.35%) 1.79s (± 1.24%) ~ 1.76s 1.82s p=0.871 n=6
Check Time 35.14s (± 0.48%) 35.13s (± 0.41%) ~ 34.94s 35.38s p=0.936 n=6
Emit Time 2.96s (± 0.92%) 2.97s (± 1.32%) ~ 2.90s 3.02s p=0.873 n=6
Total Time 45.14s (± 0.53%) 45.09s (± 0.44%) ~ 44.88s 45.46s p=1.000 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,236,880 1,236,936 +56 (+ 0.00%) ~ ~ p=0.001 n=6
Types 259,624 259,664 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,453,648k (± 0.02%) 2,634,743k (±11.48%) ~ 2,453,464k 3,177,377k p=0.230 n=6
Parse Time 5.39s (± 0.83%) 5.45s (± 1.19%) ~ 5.40s 5.57s p=0.090 n=6
Bind Time 1.83s (± 0.64%) 1.83s (± 0.75%) ~ 1.81s 1.84s p=0.740 n=6
Check Time 35.10s (± 0.45%) 35.01s (± 0.66%) ~ 34.65s 35.29s p=0.630 n=6
Emit Time 3.05s (± 1.18%) 3.04s (± 0.89%) ~ 3.00s 3.06s p=0.470 n=6
Total Time 45.37s (± 0.41%) 45.33s (± 0.66%) ~ 44.85s 45.69s p=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,407 262,408 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 103,908 103,912 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 441,662k (± 0.02%) 441,628k (± 0.02%) ~ 441,509k 441,725k p=0.575 n=6
Parse Time 4.40s (± 0.41%) 4.36s (± 0.78%) ~ 4.33s 4.42s p=0.053 n=6
Bind Time 1.61s (± 0.85%) 1.64s (± 0.84%) +0.02s (+ 1.24%) 1.62s 1.66s p=0.046 n=6
Check Time 23.45s (± 0.45%) 23.46s (± 0.32%) ~ 23.36s 23.57s p=1.000 n=6
Emit Time 1.90s (± 1.17%) 1.90s (± 0.74%) ~ 1.88s 1.92s p=0.935 n=6
Total Time 31.36s (± 0.37%) 31.36s (± 0.22%) ~ 31.29s 31.48s p=0.572 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,367 225,368 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 94,290 94,291 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 371,124k (± 0.01%) 371,140k (± 0.02%) ~ 371,080k 371,238k p=1.000 n=6
Parse Time 3.59s (± 0.86%) 3.58s (± 1.43%) ~ 3.51s 3.65s p=0.629 n=6
Bind Time 1.97s (± 0.52%) 1.97s (± 0.95%) ~ 1.95s 2.00s p=0.461 n=6
Check Time 20.36s (± 0.33%) 20.40s (± 0.43%) ~ 20.24s 20.49s p=0.377 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.92s (± 0.36%) 25.96s (± 0.31%) ~ 25.81s 26.03s p=0.630 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,865,362 3,865,526 +164 (+ 0.00%) ~ ~ p=0.001 n=6
Types 1,217,734 1,217,812 +78 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 3,693,547k (± 0.00%) 3,693,657k (± 0.00%) ~ 3,693,466k 3,693,868k p=0.471 n=6
Parse Time 18.81s (± 0.41%) 19.03s (± 2.75%) ~ 18.75s 20.09s p=0.574 n=6
Bind Time 6.04s (± 0.32%) 6.04s (± 0.54%) ~ 5.98s 6.08s p=0.686 n=6
Check Time 124.55s (± 2.07%) 128.74s (± 4.31%) ~ 121.51s 135.62s p=0.173 n=6
Emit Time 41.11s (±10.36%) 39.13s (±10.53%) ~ 37.23s 47.54s p=0.748 n=6
Total Time 190.51s (± 2.11%) 192.94s (± 4.45%) ~ 183.80s 207.97s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 321,083 321,106 +23 (+ 0.01%) ~ ~ p=0.001 n=6
Types 139,995 140,012 +17 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 478,728k (± 0.03%) 478,708k (± 0.03%) ~ 478,453k 478,877k p=0.689 n=6
Parse Time 4.41s (± 0.84%) 4.41s (± 0.62%) ~ 4.37s 4.44s p=0.872 n=6
Bind Time 1.87s (± 0.65%) 1.86s (± 1.77%) ~ 1.80s 1.89s p=0.622 n=6
Check Time 21.10s (± 0.48%) 21.14s (± 0.53%) ~ 21.01s 21.32s p=0.628 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 27.39s (± 0.32%) 27.42s (± 0.41%) ~ 27.27s 27.57s p=0.810 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 666,064 666,073 +9 (+ 0.00%) ~ ~ p=0.001 n=6
Types 199,729 199,742 +13 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 572,535k (± 0.02%) 572,581k (± 0.02%) ~ 572,373k 572,742k p=0.689 n=6
Parse Time 4.28s (± 0.55%) 4.28s (± 0.78%) ~ 4.23s 4.33s p=0.686 n=6
Bind Time 1.33s (± 1.41%) 1.33s (± 0.95%) ~ 1.31s 1.34s p=0.682 n=6
Check Time 20.38s (± 2.19%) 20.08s (± 1.46%) ~ 19.90s 20.67s p=0.261 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.98s (± 1.83%) 25.69s (± 1.10%) ~ 25.54s 26.27s p=0.470 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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60121/merge:

Everything looks good!

@jakebailey
Copy link
Member

The DT one implies that this shouldn't apply in declaration files.

    focus({ emitSynthFocused }?: {
        emitSynthFocused: boolean;
    }): Promise<void>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Destructuring a possibly undefined object not caught, throws an error at runtime Destructuring object with generic key should reject undefined

4 participants