Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on syntactically impossible ===s to undefined #60433

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RyanCavanaugh
Copy link
Member

Not a fully-correct implementation yet. Error message is just a placeholder so I can run top800 and see who's comparing what to undefined

Error message is just a placeholder so I can run top800
@RyanCavanaugh
Copy link
Member Author

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 6, 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

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.json

tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh
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 35 +1 (+ 2.94%) ~ ~ p=0.001 n=6
Symbols 62,363 62,363 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 193,107k (± 0.08%) 194,379k (± 0.92%) ~ 193,032k 196,690k p=0.128 n=6
Parse Time 1.31s (± 0.89%) 1.32s (± 1.05%) ~ 1.29s 1.33s p=0.315 n=6
Bind Time 0.72s 0.72s ~ ~ ~ p=1.000 n=6
Check Time 9.82s (± 0.48%) 9.92s (± 0.34%) +0.09s (+ 0.95%) 9.87s 9.97s p=0.008 n=6
Emit Time 2.73s (± 0.38%) 2.73s (± 0.63%) ~ 2.71s 2.76s p=0.564 n=6
Total Time 14.57s (± 0.32%) 14.68s (± 0.23%) +0.11s (+ 0.72%) 14.63s 14.71s p=0.006 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 947,936 947,936 ~ ~ ~ p=1.000 n=6
Types 410,955 410,955 ~ ~ ~ p=1.000 n=6
Memory used 1,226,075k (± 0.00%) 1,226,044k (± 0.00%) ~ 1,226,012k 1,226,091k p=0.128 n=6
Parse Time 6.64s (± 0.52%) 6.68s (± 0.76%) ~ 6.61s 6.74s p=0.108 n=6
Bind Time 1.89s (± 0.88%) 1.88s (± 0.29%) ~ 1.88s 1.89s p=0.663 n=6
Check Time 31.91s (± 0.21%) 32.05s (± 0.27%) +0.14s (+ 0.45%) 31.95s 32.19s p=0.015 n=6
Emit Time 15.19s (± 0.43%) 15.20s (± 0.28%) ~ 15.15s 15.25s p=0.520 n=6
Total Time 55.63s (± 0.17%) 55.82s (± 0.13%) +0.19s (+ 0.35%) 55.76s 55.95s p=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,495,220 2,495,220 ~ ~ ~ p=1.000 n=6
Types 908,772 908,772 ~ ~ ~ p=1.000 n=6
Memory used 2,314,172k (± 0.00%) 2,314,179k (± 0.00%) ~ 2,314,160k 2,314,194k p=0.810 n=6
Parse Time 9.33s (± 0.25%) 9.33s (± 0.33%) ~ 9.29s 9.36s p=0.871 n=6
Bind Time 2.14s (± 0.46%) 2.14s (± 0.42%) ~ 2.13s 2.15s p=0.931 n=6
Check Time 75.25s (± 0.41%) 75.39s (± 0.37%) ~ 75.10s 75.68s p=0.688 n=6
Emit Time 0.27s (± 1.89%) 0.28s (± 2.26%) ~ 0.27s 0.29s p=0.091 n=6
Total Time 87.00s (± 0.34%) 87.14s (± 0.34%) ~ 86.81s 87.47s p=0.471 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,381 1,225,382 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,555 266,555 ~ ~ ~ p=1.000 n=6
Memory used 2,354,579k (± 0.02%) 2,415,587k (± 6.14%) ~ 2,354,539k 2,718,514k p=0.173 n=6
Parse Time 5.25s (± 0.59%) 5.21s (± 0.87%) ~ 5.13s 5.25s p=0.170 n=6
Bind Time 1.78s (± 1.05%) 1.78s (± 1.09%) ~ 1.76s 1.81s p=1.000 n=6
Check Time 35.33s (± 0.72%) 35.38s (± 0.70%) ~ 34.91s 35.64s p=0.297 n=6
Emit Time 2.97s (± 1.04%) 2.98s (± 0.62%) ~ 2.97s 3.02s p=0.747 n=6
Total Time 45.33s (± 0.62%) 45.35s (± 0.56%) ~ 44.87s 45.61s p=0.471 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,381 1,225,382 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,555 266,555 ~ ~ ~ p=1.000 n=6
Memory used 2,787,803k (±14.21%) 2,908,356k (±12.85%) ~ 2,424,048k 3,151,095k p=0.810 n=6
Parse Time 6.92s (± 1.85%) 6.97s (± 1.52%) ~ 6.82s 7.06s p=0.298 n=6
Bind Time 2.15s (± 1.98%) 2.13s (± 1.37%) ~ 2.09s 2.16s p=0.573 n=6
Check Time 42.59s (± 0.51%) 43.23s (± 0.60%) +0.63s (+ 1.49%) 42.91s 43.65s p=0.005 n=6
Emit Time 3.47s (± 2.76%) 3.51s (± 3.32%) ~ 3.34s 3.66s p=0.470 n=6
Total Time 55.13s (± 0.58%) 55.83s (± 0.56%) +0.70s (+ 1.26%) 55.29s 56.27s p=0.008 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,222 262,223 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,607 106,607 ~ ~ ~ p=1.000 n=6
Memory used 439,805k (± 0.02%) 439,961k (± 0.01%) +156k (+ 0.04%) 439,896k 440,037k p=0.020 n=6
Parse Time 3.54s (± 0.84%) 3.54s (± 0.73%) ~ 3.50s 3.58s p=1.000 n=6
Bind Time 1.32s (± 0.89%) 1.32s (± 0.57%) ~ 1.31s 1.33s p=0.796 n=6
Check Time 18.93s (± 0.37%) 19.14s (± 0.47%) +0.21s (+ 1.13%) 19.06s 19.28s p=0.005 n=6
Emit Time 1.52s (± 0.49%) 1.54s (± 0.58%) +0.02s (+ 1.20%) 1.53s 1.55s p=0.011 n=6
Total Time 25.31s (± 0.27%) 25.54s (± 0.41%) +0.23s (+ 0.92%) 25.41s 25.68s p=0.008 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 70 70 ~ ~ ~ p=1.000 n=6
Symbols 226,062 226,062 ~ ~ ~ p=1.000 n=6
Types 94,488 94,488 ~ ~ ~ p=1.000 n=6
Memory used 371,580k (± 0.02%) 371,726k (± 0.04%) +146k (+ 0.04%) 371,632k 372,004k p=0.031 n=6
Parse Time 2.89s (± 1.26%) 2.89s (± 0.63%) ~ 2.87s 2.92s p=0.936 n=6
Bind Time 1.59s (± 0.51%) 1.59s (± 1.28%) ~ 1.55s 1.61s p=0.866 n=6
Check Time 16.48s (± 0.33%) 16.61s (± 0.29%) +0.13s (+ 0.80%) 16.56s 16.67s p=0.005 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.97s (± 0.30%) 21.10s (± 0.22%) +0.13s (+ 0.61%) 21.04s 21.16s p=0.005 n=6
vscode - node (v18.15.0, x64)
Errors 11 11 ~ ~ ~ p=1.000 n=6
Symbols 3,137,130 3,137,130 ~ ~ ~ p=1.000 n=6
Types 1,081,270 1,081,270 ~ ~ ~ p=1.000 n=6
Memory used 3,231,163k (± 0.01%) 3,231,278k (± 0.01%) ~ 3,230,602k 3,231,575k p=0.936 n=6
Parse Time 14.14s (± 0.41%) 14.10s (± 0.61%) ~ 13.97s 14.23s p=0.378 n=6
Bind Time 4.48s (± 0.67%) 4.51s (± 2.63%) ~ 4.43s 4.75s p=0.682 n=6
Check Time 85.39s (± 0.44%) 86.54s (± 2.02%) ~ 84.97s 88.89s p=0.298 n=6
Emit Time 27.75s (± 2.86%) 26.55s (± 6.58%) ~ 22.98s 27.35s p=0.574 n=6
Total Time 131.76s (± 0.79%) 131.69s (± 2.00%) ~ 127.53s 134.79s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 0 2 🔻+2 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 288,119 288,119 ~ ~ ~ p=1.000 n=6
Types 116,928 116,928 ~ ~ ~ p=1.000 n=6
Memory used 439,790k (± 0.03%) 439,815k (± 0.02%) ~ 439,747k 439,951k p=1.000 n=6
Parse Time 4.06s (± 1.16%) 4.08s (± 1.22%) ~ 4.00s 4.14s p=0.375 n=6
Bind Time 1.76s (± 1.10%) 1.74s (± 0.67%) ~ 1.73s 1.76s p=0.087 n=6
Check Time 18.73s (± 0.55%) 18.85s (± 0.41%) ~ 18.75s 18.97s p=0.109 n=6
Emit Time 0.00s (±154.76%) 0.00s ~ ~ ~ p=0.174 n=6
Total Time 24.55s (± 0.59%) 24.68s (± 0.51%) ~ 24.48s 24.85s p=0.173 n=6
xstate-main - node (v18.15.0, x64)
Errors 8 8 ~ ~ ~ p=1.000 n=6
Symbols 543,110 543,110 ~ ~ ~ p=1.000 n=6
Types 181,830 181,830 ~ ~ ~ p=1.000 n=6
Memory used 486,419k (± 0.01%) 486,445k (± 0.01%) ~ 486,362k 486,490k p=0.128 n=6
Parse Time 3.36s (± 0.49%) 3.37s (± 0.50%) ~ 3.35s 3.39s p=0.742 n=6
Bind Time 1.18s (± 1.46%) 1.17s (± 0.71%) ~ 1.16s 1.18s p=1.000 n=6
Check Time 19.35s (± 0.40%) 19.35s (± 0.32%) ~ 19.27s 19.43s p=1.000 n=6
Emit Time 0.00s (±244.70%) 0.00s ~ ~ ~ p=0.405 n=6
Total Time 23.89s (± 0.32%) 23.89s (± 0.27%) ~ 23.82s 23.98s p=0.873 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

@RyanCavanaugh
Copy link
Member Author

@typescript-bot test top800

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 6, 2024

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

Command Status Results
test top800 ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

continuedev/continue

6 of 9 projects failed to build with the old tsc and were ignored

gui/tsconfig.json

formatjs/formatjs

29 of 37 projects failed to build with the old tsc and were ignored

packages/intl-segmenter/tsconfig.json

javascript-obfuscator/javascript-obfuscator

tsconfig.json

test/tsconfig.test.json

src/tsconfig.typings.json

src/tsconfig.browser.json

nhn/tui.editor

4 of 9 projects failed to build with the old tsc and were ignored

plugins/code-syntax-highlight/tsconfig.json

@RyanCavanaugh
Copy link
Member Author

Webpack had two instances of this (both of which had lint suppressions which were applied in a routine dep upgrade)

if (!this._redirectTo !== undefined) {

javascript-obfuscator had

    public static isNode (object: Object & { type?: string }): object is ESTree.Node {
        return object && !object.type !== undefined;
    }

Everything else was some variant of

    typeof x === undefined

There was also a false positive, #60439

@typescript-bot
Copy link
Collaborator

@RyanCavanaugh Here are the results of running the top 800 repos with tsc comparing main and refs/pull/60433/merge:

Something interesting changed - please have a look.

Details

continuedev/continue

6 of 9 projects failed to build with the old tsc and were ignored

gui/tsconfig.json

formatjs/formatjs

29 of 37 projects failed to build with the old tsc and were ignored

packages/intl-segmenter/tsconfig.json

javascript-obfuscator/javascript-obfuscator

tsconfig.json

test/tsconfig.test.json

src/tsconfig.typings.json

src/tsconfig.browser.json

nhn/tui.editor

4 of 9 projects failed to build with the old tsc and were ignored

plugins/code-syntax-highlight/tsconfig.json

@ljharb
Copy link
Contributor

ljharb commented Nov 6, 2024

new.target can definitely be undefined, so the formatjs warning is a bug (as is the continue one, i think?)

@RyanCavanaugh
Copy link
Member Author

Both continue hits look like bugs to me

   <Div dashed={typeof props.llm === undefined}>
   {typeof modelOptions.apiKey !== undefined &&

@ljharb
Copy link
Contributor

ljharb commented Nov 7, 2024

props.llm has a type of any | undefined, so it can definitely be undefined, and the ? in https://github.com/continuedev/continue/blob/56b19b4344b4db1067cab951d54b7968f63e2736/gui/src/components/modelSelection/ModelSettings.tsx#L17 means that modelOptions.apiKey can be undefined, no?

update: gotcha, you're saying they're bugs in this PR, which i agree with :-)

@RyanCavanaugh
Copy link
Member Author

@ljharb no, the user code has a bug, the PR is correct. typeof undefined is "undefined" (the string) but this code compares it to undefined. This is the motivating example for the PR to exist in the first place; see #60425

@ljharb
Copy link
Contributor

ljharb commented Nov 7, 2024

aha, you are of course correct :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants