GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Uncalled function checks check negation condition by AlexMarkUSDS · Pull Request #57114 · microsoft/TypeScript

Conversation

@AlexMarkUSDS

@AlexMarkUSDS Alex Mark (AlexMarkUSDS) commented Jan 21, 2024

Copy link
Copy Markdown

Fixes #34815
Fixes #43096

This PR is partially a revival of #43097, which had gone stale and was closed. Thank you Jonas Hübotter (@jonhue) for pointing me off in the right direction.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AlexMarkUSDS
Uncalled function checks check negation condition
09cced4
@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 21, 2024
@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

The TypeScript team hasn't accepted the linked issue #34815. If you can get it accepted, this PR will have a better chance of being reviewed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexMarkUSDS

Alex Mark (AlexMarkUSDS) commented Jan 21, 2024

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Alex Mark (AlexMarkUSDS) added 4 commits January 21, 2024 10:18
@AlexMarkUSDS
Fix format
00cc8ff
@AlexMarkUSDS
Workaround compile issues caused by PR
3793795
@AlexMarkUSDS
Take a riskier approach to removing host.fileExists
bdb2698
@AlexMarkUSDS
Remove unnecessary system.getEnvironmentVariable call
a9abcb4
AlexMarkUSDS
Alex Mark (AlexMarkUSDS) commented Jan 21, 2024
View reviewed changes

@AlexMarkUSDS Alex Mark (AlexMarkUSDS) left a comment

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

My final commits show changes to the compiler caused by this change. A number of paths were revealed to be unreachable by this commit, so I've removed that code and left comments as to why I think that was safe to do.

If I was wrong (and I am not familiar with TS internals, so I easily could be), or if that makes the scope of this PR larger than you'd like), I'm happy to go back and replace those with explicit undefined checks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/compiler/moduleSpecifiers.ts

function tryGetModuleNameAsNodeModule({ path, isRedirect }: ModulePath, { getCanonicalFileName, canonicalSourceDirectory }: Info, importingSourceFile: SourceFile, host: ModuleSpecifierResolutionHost, options: CompilerOptions, userPreferences: UserPreferences, packageNameOnly?: boolean, overrideMode?: ResolutionMode): string | undefined {
if (!host.fileExists || !host.readFile) {
if (!host.readFile) {

@AlexMarkUSDS Alex Mark (AlexMarkUSDS) Jan 21, 2024

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

On the ModuleSpecifierResolutionHost, host.fileExists is always defined, but host.readFile is optionally defined.

Searching the codebase for host.fileExists showed it being used multiple times without a check, so I felt safe removing this. If you think this is wrong or risky, I'm happy to replace this with

if (host.fileExists === undefined || !host.readFile)

or however you think the codebase is best maintained.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey Jake Bailey (jakebailey) Jan 21, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This one I believe is correct; this same change was made in #53463.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/compiler/sys.ts
export let unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);

function setCustomPollingValues(system: System) {
if (!system.getEnvironmentVariable) {

@AlexMarkUSDS Alex Mark (AlexMarkUSDS) Jan 21, 2024

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I used VSCode to search for all implementations of System and found only the node System defined in this file. getEnvironmentVariable is always defined as

            getEnvironmentVariable(name: string) {
                return process.env[name] || "";
            },

so I felt safe removing this check -- the condition cannot currently evaluate to true.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey Jake Bailey (jakebailey) Jan 21, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

There are theoretically external implementations of sys out there, and I'm guessing this guards against them. https://github.com/ionic-team/stencil/blob/fa5ab1b75f19e1117f0cead1caaf6b00ddccadf3/src/compiler/sys/typescript/typescript-sys.ts#L182 (but this code is non-functional post 5.0)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexMarkUSDS reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/services/stringCompletions.ts
}

function enumerateNodeModulesVisibleToScript(host: LanguageServiceHost, scriptPath: string): readonly string[] {
if (!host.readFile || !host.fileExists) return emptyArray;

@AlexMarkUSDS Alex Mark (AlexMarkUSDS) Jan 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The LanguageServiceHost has a comment

     * Unlike `realpath and `readDirectory`, `readFile` and `fileExists` are now _required_
     * to properly acquire and setup source files under module: node16+ modes.

so I believe these checks have been unnecessary since the compiler was converted to modules in #51387

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey Jake Bailey (jakebailey) Jan 21, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would git blame this; node16 is a "recent" addition and requiring those would be new, so this is likely a compatibility shim to ensure that older callers don't crash. We do this sort of thing somewhat often when making "breaking" API changes (but, still detecting older uses and trying to fix them within reason).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AlexMarkUSDS Alex Mark (AlexMarkUSDS) Jan 21, 2024

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It looks like it went in 6 years ago with 70682b7#diff-10538e33f93edc9b510a4cd505ecaa718f6ab878a54b7d044a18ef10b1e36792R383 .

Better understanding the compatibility shim, I'll undo the changes that assume host.readFile and host.fileExists. I wouldn't want an innocent change like this to break someone's module compatibility.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AlexMarkUSDS Alex Mark (AlexMarkUSDS) mentioned this pull request Jan 21, 2024
Uncalled Function Checks don't check negative condition #34815
Open
@jakebailey

Jake Bailey (jakebailey) commented Jan 21, 2024

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test top200
TypeScript Bot (@typescript-bot) user test this
TypeScript Bot (@typescript-bot) run dt

TypeScript Bot (@typescript-bot) perf test this faster
TypeScript Bot (@typescript-bot) pack this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the faster perf test suite on this PR at a9abcb4. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the parallelized Definitely Typed test suite on this PR at a9abcb4. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at a9abcb4. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at a9abcb4. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the diff-based top-repos suite on this PR at a9abcb4. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@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/159591/artifacts?artifactName=tgz&fileId=0DC22183E915A9D380FB43D26D99F40F4A9A1448C7F8E1164609A1460BD5589402&fileName=/typescript-5.4.0-insiders.20240121.tgz"
    }
}

and then running npm install.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing main and refs/pull/57114/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

lodash

/mnt/ts_downloads/lodash/tsconfig.json

  • [NEW] error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • /mnt/ts_downloads/lodash/node_modules/lodash/_getSymbols.js(20,19)
    • /mnt/ts_downloads/lodash/node_modules/lodash/_getSymbolsIn.js(16,21)

puppeteer

packages/browsers/test/src/tsconfig.json

  • [MISSING] error TS2307: Cannot find module '@pptr/testserver' or its corresponding type declarations.
    • packages/browsers/test/src/utils.ts#L13 in packages/browsers/test/src/tsconfig.json

webpack

tsconfig.types.json

  • [NEW] error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • lib/NormalModule.js#L715
    • lib/cache/PackFileCacheStrategy.js#L874
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: yandex-maps
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/yandex-maps/yandex-maps-tests.ts
  162:10  error  TypeScript@local compile error: 
This condition will always return true since this function is always defined. Did you mean to call it instead?  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: activex-excel
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/activex-excel/activex-excel-tests.ts
  98:10  error  TypeScript@local compile error: 
This condition will always return true since this function is always defined. Did you mean to call it instead?  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: js-fixtures
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/js-fixtures/js-fixtures-tests.ts
  16:10  error  TypeScript@local compile error: 
This condition will always return true since this function is always defined. Did you mean to call it instead?  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: morgan
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/morgan/morgan-tests.ts
  88:10  error  TypeScript@local compile error: 
This condition will always return true since this function is always defined. Did you mean to call it instead?  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: xdate
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/xdate/xdate-tests.ts
  1177:18  error  TypeScript@local compile error: 
This condition will always return true since this function is always defined. Did you mean to call it instead?  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

You can check the log here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

Jake Bailey (@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
Angular - node (v18.15.0, x64)
Memory used 295,652k (± 0.01%) 295,657k (± 0.01%) ~ 295,620k 295,713k p=1.000 n=6
Parse Time 2.67s (± 0.31%) 2.66s (± 0.51%) ~ 2.64s 2.68s p=0.865 n=6
Bind Time 0.83s (± 1.24%) 0.83s (± 1.32%) ~ 0.82s 0.85s p=0.546 n=6
Check Time 8.19s (± 0.32%) 8.20s (± 0.16%) ~ 8.18s 8.22s p=0.191 n=6
Emit Time 7.10s (± 0.21%) 7.12s (± 0.48%) ~ 7.08s 7.18s p=0.196 n=6
Total Time 18.79s (± 0.13%) 18.82s (± 0.26%) ~ 18.78s 18.90s p=0.220 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 194,434k (± 1.65%) 193,945k (± 1.48%) ~ 191,544k 197,491k p=0.471 n=6
Parse Time 1.36s (± 1.37%) 1.35s (± 2.27%) ~ 1.29s 1.38s p=0.744 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.35s (± 0.36%) 9.35s (± 0.26%) ~ 9.31s 9.38s p=0.746 n=6
Emit Time 2.61s (± 1.01%) 2.62s (± 0.68%) ~ 2.59s 2.64s p=0.462 n=6
Total Time 14.04s (± 0.19%) 14.04s (± 0.27%) ~ 13.97s 14.08s p=1.000 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,461k (± 0.01%) 347,448k (± 0.01%) ~ 347,422k 347,476k p=0.471 n=6
Parse Time 2.49s (± 0.55%) 2.48s (± 0.30%) ~ 2.47s 2.49s p=0.196 n=6
Bind Time 0.93s (± 0.56%) 0.93s (± 0.00%) ~ 0.93s 0.93s p=0.174 n=6
Check Time 6.94s (± 0.78%) 6.94s (± 0.51%) ~ 6.90s 7.00s p=0.872 n=6
Emit Time 4.05s (± 0.47%) 4.06s (± 0.40%) ~ 4.04s 4.08s p=0.570 n=6
Total Time 14.40s (± 0.54%) 14.40s (± 0.27%) ~ 14.38s 14.48s p=0.872 n=6
TFS - node (v18.15.0, x64)
Memory used 302,831k (± 0.00%) 302,832k (± 0.00%) ~ 302,808k 302,845k p=0.689 n=6
Parse Time 2.02s (± 0.51%) 2.02s (± 0.68%) ~ 1.99s 2.03s p=1.000 n=6
Bind Time 1.00s (± 0.41%) 0.99s (± 1.49%) -0.01s (- 1.33%) 0.96s 1.00s p=0.024 n=6
Check Time 6.33s (± 0.28%) 6.33s (± 0.28%) ~ 6.31s 6.35s p=0.806 n=6
Emit Time 3.61s (± 0.21%) 3.61s (± 0.46%) ~ 3.59s 3.63s p=0.367 n=6
Total Time 12.96s (± 0.15%) 12.94s (± 0.19%) ~ 12.89s 12.96s p=0.101 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,291k (± 0.00%) 511,311k (± 0.00%) ~ 511,274k 511,330k p=0.230 n=6
Parse Time 2.65s (± 0.46%) 2.66s (± 0.24%) ~ 2.65s 2.67s p=0.340 n=6
Bind Time 1.00s (± 0.84%) 1.00s (± 1.17%) ~ 0.99s 1.02s p=1.000 n=6
Check Time 17.24s (± 0.44%) 17.22s (± 0.26%) ~ 17.16s 17.29s p=0.629 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.89s (± 0.38%) 20.87s (± 0.23%) ~ 20.82s 20.95s p=0.936 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,696,015k (± 0.00%) 1,696,010k (± 0.00%) ~ 1,695,967k 1,696,060k p=0.873 n=6
Parse Time 6.54s (± 0.30%) 6.54s (± 0.22%) ~ 6.52s 6.56s p=0.683 n=6
Bind Time 2.35s (± 0.44%) 2.35s (± 0.44%) ~ 2.34s 2.37s p=1.000 n=6
Check Time 55.50s (± 0.38%) 55.41s (± 0.17%) ~ 55.25s 55.52s p=0.689 n=6
Emit Time 0.16s (± 2.52%) 0.16s (± 0.00%) ~ 0.16s 0.16s p=0.405 n=6
Total Time 64.55s (± 0.35%) 64.46s (± 0.15%) ~ 64.31s 64.56s p=0.748 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,413,079k (± 0.03%) 2,413,247k (± 0.02%) ~ 2,412,594k 2,413,824k p=0.230 n=6
Parse Time 4.92s (± 0.81%) 4.94s (± 1.07%) ~ 4.88s 5.02s p=0.470 n=6
Bind Time 1.87s (± 1.46%) 1.89s (± 0.72%) ~ 1.87s 1.90s p=0.459 n=6
Check Time 33.42s (± 0.38%) 33.63s (± 0.30%) +0.20s (+ 0.61%) 33.49s 33.75s p=0.020 n=6
Emit Time 2.69s (± 1.04%) 2.71s (± 1.86%) ~ 2.66s 2.78s p=0.689 n=6
Total Time 42.92s (± 0.28%) 43.19s (± 0.14%) +0.27s (+ 0.64%) 43.11s 43.27s p=0.005 n=6
self-compiler - node (v18.15.0, x64)
Memory used 419,725k (± 0.01%) 419,705k (± 0.01%) ~ 419,641k 419,750k p=0.471 n=6
Parse Time 2.77s (± 2.87%) 2.72s (± 3.09%) ~ 2.64s 2.83s p=0.295 n=6
Bind Time 1.12s (± 6.02%) 1.17s (± 6.93%) ~ 1.07s 1.24s p=0.325 n=6
Check Time 15.11s (± 0.40%) 15.16s (± 0.24%) ~ 15.12s 15.21s p=0.091 n=6
Emit Time 1.14s (± 2.04%) 1.14s (± 1.21%) ~ 1.12s 1.16s p=0.742 n=6
Total Time 20.15s (± 0.41%) 20.20s (± 0.13%) ~ 20.15s 20.23s p=0.106 n=6
vscode - node (v18.15.0, x64)
Memory used 2,807,087k (± 0.00%) 2,807,408k (± 0.00%) +321k (+ 0.01%) 2,807,357k 2,807,477k p=0.005 n=6
Parse Time 10.63s (± 0.28%) 10.65s (± 0.22%) ~ 10.62s 10.69s p=0.286 n=6
Bind Time 3.38s (± 0.60%) 3.37s (± 0.27%) ~ 3.36s 3.38s p=0.222 n=6
Check Time 59.71s (± 0.43%) 60.13s (± 0.60%) ~ 59.74s 60.64s p=0.128 n=6
Emit Time 16.16s (± 0.34%) 16.08s (± 0.30%) -0.08s (- 0.47%) 16.01s 16.13s p=0.045 n=6
Total Time 89.89s (± 0.31%) 90.24s (± 0.39%) ~ 89.91s 90.77s p=0.199 n=6
webpack - node (v18.15.0, x64)
Memory used 392,454k (± 0.02%) 392,439k (± 0.01%) ~ 392,372k 392,533k p=0.810 n=6
Parse Time 3.06s (± 0.64%) 3.04s (± 0.82%) ~ 3.01s 3.07s p=0.212 n=6
Bind Time 1.40s (± 0.54%) 1.40s (± 0.60%) ~ 1.39s 1.41s p=0.432 n=6
Check Time 13.96s (± 0.38%) 13.98s (± 0.43%) ~ 13.87s 14.05s p=0.294 n=6
Emit Time 0.00s (±244.70%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=0.405 n=6
Total Time 18.41s (± 0.31%) 18.41s (± 0.33%) ~ 18.30s 18.47s p=0.688 n=6
xstate - node (v18.15.0, x64)
Memory used 513,425k (± 0.01%) 514,193k (± 0.02%) +769k (+ 0.15%) 514,037k 514,406k p=0.005 n=6
Parse Time 3.28s (± 0.30%) 3.28s (± 0.33%) ~ 3.27s 3.29s p=0.859 n=6
Bind Time 1.54s (± 0.26%) 1.54s (± 0.00%) ~ 1.54s 1.54s p=0.405 n=6
Check Time 2.85s (± 0.52%) 2.88s (± 0.82%) ~ 2.85s 2.91s p=0.053 n=6
Emit Time 0.08s (± 4.99%) 0.07s (± 7.03%) 🟩-0.01s (-10.20%) 0.07s 0.08s p=0.022 n=6
Total Time 7.76s (± 0.22%) 7.78s (± 0.43%) ~ 7.74s 7.83s p=0.257 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexMarkUSDS
Undo potentially compatibility-destroying changes
4bac889
@AlexMarkUSDS

Alex Mark (AlexMarkUSDS) commented Jan 21, 2024

Copy link
Copy Markdown
Author

Hey Jake Bailey (@jakebailey) -- thank you for such a quick review. I've re-added the 3 statements that may be required for back-compatibility with 4bac889.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexMarkUSDS
Format
a5d6425
@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 21, 2024

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing main and refs/pull/57114/merge:

Something interesting changed - please have a look.

Details

apollographql/apollo-client

1 of 11 projects failed to build with the old tsc and were ignored

src/tsconfig.json

  • error TS2801: This condition will always return true since this 'Promise<string>' is always defined.
    • src/link/persisted-queries/index.ts#L139

tsconfig.json

  • error TS2801: This condition will always return true since this 'Promise<string>' is always defined.
    • src/link/persisted-queries/index.ts#L139

calcom/cal.com

19 of 22 projects failed to build with the old tsc and were ignored

packages/embeds/embed-core/tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • packages/embeds/embed-core/src/embed.ts#L48
    • packages/embeds/embed-core/src/embed.ts#L717
    • packages/embeds/embed-core/src/embed.ts#L861
    • packages/embeds/embed-core/src/preview.ts#L81

packages/embeds/embed-react/tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • packages/embeds/embed-react/src/index.ts#L12

chakra-ui/chakra-ui

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

packages/components/tsconfig.build.json

  • error TS5056: Cannot write file '/mnt/ts_downloads/chakra-ui/packages/components/dist/types/menu/menu.stories.d.ts' because it would be overwritten by multiple input files.
    • Project Scope

cheeriojs/cheerio

1 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/static.ts#L25

date-fns/date-fns

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

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/formatDuration/index.ts#L99

tsconfig.lib.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/formatDuration/index.ts#L99

desktop/desktop

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

tsconfig.json

  • error TS2801: This condition will always return true since this 'Promise<boolean>' is always defined.
    • app/src/lib/git/cherry-pick.ts#L219
    • app/src/lib/git/cherry-pick.ts#L301
    • app/src/lib/stores/app-store.ts#L7063

jhipster/generator-jhipster

1 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • generators/base-core/generator.ts#L324
    • generators/base-core/generator.ts#L372
    • jdl/models/jdl-application-configuration.ts#L59
    • jdl/models/jdl-entity.ts#L60
    • jdl/models/jdl-object.ts#L144
    • jdl/models/jdl-object.ts#L231
    • jdl/models/jdl-relationships.ts#L91

tsconfig.types.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • generators/base-core/generator.ts#L324
    • generators/base-core/generator.ts#L372
    • jdl/models/jdl-application-configuration.ts#L59
    • jdl/models/jdl-entity.ts#L60
    • jdl/models/jdl-object.ts#L144
    • jdl/models/jdl-object.ts#L231
    • jdl/models/jdl-relationships.ts#L91

jitsi/jitsi-meet

tsconfig.web.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • react/features/screenshot-capture/functions.tsx#L18
    • react/features/stream-effects/virtual-background/index.ts#L41

lobehub/lobe-chat

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/features/Conversation/Plugins/Render/BuiltinType/index.tsx#L24
    • src/features/Conversation/components/ChatItem/index.tsx#L65
    • src/store/tool/slices/builtin/action.ts#L39

microsoft/vscode

3 of 54 projects failed to build with the old tsc and were ignored

extensions/css-language-features/server/tsconfig.json

  • error TS2801: This condition will always return true since this 'Thenable<import("/mnt/ts_downloads/vscode/extensions/css-language-features/server/node_modules/vscode-css-languageservice/lib/umd/cssLanguageTypes").LanguageSettings | undefined>' is always defined.
    • extensions/css-language-features/server/src/cssServer.ts#L155

extensions/emmet/tsconfig.json

  • error TS2801: This condition will always return true since this 'Thenable<boolean | undefined>' is always defined.
    • extensions/emmet/src/test/abbreviationAction.test.ts#L223
    • extensions/emmet/src/test/abbreviationAction.test.ts#L272
    • extensions/emmet/src/test/abbreviationAction.test.ts#L311
    • extensions/emmet/src/test/abbreviationAction.test.ts#L370
    • extensions/emmet/src/test/abbreviationAction.test.ts#L512
  • error TS2801: This condition will always return true since this 'Promise<boolean>' is always defined.
    • extensions/emmet/src/test/wrapWithAbbreviation.test.ts#L494
    • extensions/emmet/src/test/wrapWithAbbreviation.test.ts#L510

extensions/gulp/tsconfig.json

  • error TS2801: This condition will always return true since this 'Promise<boolean>' is always defined.
    • extensions/gulp/src/main.ts#L184

extensions/html-language-features/server/tsconfig.json

  • error TS2801: This condition will always return true since this 'Thenable<import("/mnt/ts_downloads/vscode/extensions/html-language-features/server/src/modes/languageModes").Settings>' is always defined.
    • extensions/html-language-features/server/src/htmlServer.ts#L121

src/tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/vs/base/browser/dom.ts#L140
    • src/vs/base/common/event.ts#L1121
    • src/vs/platform/encryption/electron-main/encryptionMainService.ts#L94
    • src/vs/platform/terminal/node/ptyHostService.ts#L338
    • src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts#L311
    • src/vs/workbench/contrib/terminal/browser/remotePty.ts#L116
    • src/vs/workbench/contrib/terminal/electron-sandbox/localPty.ts#L88
    • src/vs/workbench/services/remote/common/remoteExplorerService.ts#L228
  • error TS2801: This condition will always return true since this 'Promise<string>' is always defined.
    • src/vs/base/node/id.ts#L82
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/vscode/src/vs/workbench/common/panecomposite").IPaneComposite | undefined>' is always defined.
    • src/vs/workbench/browser/layout.ts#L1803
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/vscode/src/vs/workbench/contrib/tasks/common/taskSystem").ITaskSummary>' is always defined.
    • src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts#L523
  • error TS2801: This condition will always return true since this 'Promise<Record<string, true>>' is always defined.
    • src/vs/workbench/services/search/common/search.ts#L746
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/vscode/src/vs/workbench/services/textMate/common/TMGrammarFactory").ICreateGrammarResult>' is always defined.
    • src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.ts#L115

src/tsconfig.monaco.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/vs/base/browser/dom.ts#L140
    • src/vs/base/common/event.ts#L1121

src/tsconfig.tsec.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/vs/base/browser/dom.ts#L140
    • src/vs/base/common/event.ts#L1121
    • src/vs/platform/encryption/electron-main/encryptionMainService.ts#L94
    • src/vs/platform/terminal/node/ptyHostService.ts#L338
    • src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts#L311
    • src/vs/workbench/contrib/terminal/browser/remotePty.ts#L116
    • src/vs/workbench/contrib/terminal/electron-sandbox/localPty.ts#L88
    • src/vs/workbench/services/remote/common/remoteExplorerService.ts#L228
  • error TS2801: This condition will always return true since this 'Promise<string>' is always defined.
    • src/vs/base/node/id.ts#L82
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/vscode/src/vs/workbench/common/panecomposite").IPaneComposite | undefined>' is always defined.
    • src/vs/workbench/browser/layout.ts#L1803
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/vscode/src/vs/workbench/contrib/tasks/common/taskSystem").ITaskSummary>' is always defined.
    • src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts#L523
  • error TS2801: This condition will always return true since this 'Promise<Record<string, true>>' is always defined.
    • src/vs/workbench/services/search/common/search.ts#L746
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/vscode/src/vs/workbench/services/textMate/common/TMGrammarFactory").ICreateGrammarResult>' is always defined.
    • src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.ts#L115

outline/outline

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • shared/editor/queries/findChildren.ts#L42

portainer/portainer

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • app/react/components/Icon.tsx#L75
    • app/react/components/Svg.tsx#L82

prisma/prisma

85 of 106 projects failed to build with the old tsc and were ignored

packages/migrate/tsconfig.build.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • packages/migrate/src/utils/promptForMigrationName.ts#L21

pubkey/rxdb

10 of 11 projects failed to build with the old tsc and were ignored

config/tsconfig.types.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/plugin-helpers.ts#L106
    • src/rx-schema.ts#L124

ReactiveX/rxjs

11 of 15 projects failed to build with the old tsc and were ignored

packages/rxjs/src/tsconfig.cjs.spec.json

  • error TS2801: This condition will always return true since this 'Promise<any>' is always defined.
    • packages/rxjs/src/internal/util/Immediate.ts#L26

packages/rxjs/src/tsconfig.types.json

  • error TS2801: This condition will always return true since this 'Promise<any>' is always defined.
    • packages/rxjs/src/internal/util/Immediate.ts#L26 in packages/rxjs/src/tsconfig.types.json

redis/node-redis

1 of 8 projects failed to build with the old tsc and were ignored

packages/test-utils/tsconfig.json

  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/node-redis/packages/test-utils/lib/dockers").RedisServerDocker>' is always defined.
    • packages/test-utils/lib/index.ts#L135
  • error TS2801: This condition will always return true since this 'Promise<import("/mnt/ts_downloads/node-redis/packages/test-utils/lib/dockers").RedisServerDocker[]>' is always defined.
    • packages/test-utils/lib/index.ts#L202

vercel/swr

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

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • src/mutation/index.ts#L47
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexMarkUSDS

Alex Mark (AlexMarkUSDS) commented Feb 13, 2024

Copy link
Copy Markdown
Author

I'm happy to close this out (or have it closed) based on the discussion of #34815 -- it's a lot of false positives.

RyanCavanaugh reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) closed this Feb 13, 2024
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@jakebailey Jake Bailey (jakebailey) jakebailey left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

PR Backlog
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uncalled function checks don't work with negation Uncalled Function Checks don't check negative condition

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@AlexMarkUSDS @typescript-bot @jakebailey @RyanCavanaugh
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.