Skip to content

Conversation

@puppy0cam
Copy link

Fixes #33525

Copilot AI review requested due to automatic review settings October 25, 2025 10:48
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Oct 25, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Oct 25, 2025
Copy link

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 fixes an issue where imports used only in computed property names of abstract class members were not being properly elided during compilation. Abstract members don't generate runtime code, so their imports should be removed when they're only used in type-only contexts.

Key Changes:

  • Added logic to detect when an identifier is used within a computed property name of an abstract member
  • Modified the alias reference marking to skip identifiers in abstract member computed properties, allowing their imports to be elided

Reviewed Changes

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

Show a summary per file
File Description
src/compiler/checker.ts Added isIdentifierInAbstractMemberComputedPropertyName helper function and integrated it into markIdentifierAliasReferenced to prevent marking imports as referenced when used only in abstract member computed properties
tests/cases/compiler/abstractMethodComputedPropertyElision.ts Added compiler test demonstrating the fix with both type-only and normal imports using symbols in abstract computed properties
tests/baselines/reference/abstractMethodComputedPropertyElision.types Baseline file for type checking output of the test case
tests/baselines/reference/abstractMethodComputedPropertyElision.symbols Baseline file for symbol resolution output of the test case
tests/baselines/reference/abstractMethodComputedPropertyElision.js Baseline file showing the compiled JavaScript output where imports are correctly elided
Comments suppressed due to low confidence (1)

src/compiler/checker.ts:1

  • [nitpick] The condition spans multiple lines with inconsistent parentheses grouping. The logical grouping (isMethodDeclaration || isMethodSignature || isPropertyDeclaration || isPropertySignature) should be fully enclosed in parentheses before the && operator for clarity.
import {

@puppy0cam

This comment was marked as resolved.

@RyanCavanaugh
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 28, 2025

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

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 28, 2025

Hey @RyanCavanaugh, 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/166394/artifacts?artifactName=tgz&fileId=861667B114E58349175ECC655360A8F182ED1A65E0D995FD2ABC530A79AE318002&fileName=/typescript-6.0.0-insiders.20251028.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-62673-3".;

@RyanCavanaugh
Copy link
Member

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 28, 2025

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

Command Status Results
perf test this ✅ Started 👀 Results

@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 1 1 ~ ~ ~ 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 194,897k (± 0.99%) 195,513k (± 0.80%) ~ 192,348k 196,332k p=0.689 n=6
Parse Time 1.58s (± 2.06%) 1.59s (± 1.45%) ~ 1.56s 1.63s p=0.805 n=6
Bind Time 0.88s (± 1.95%) 0.88s (± 1.37%) ~ 0.87s 0.90s p=0.806 n=6
Check Time 11.74s (± 0.38%) 11.76s (± 0.45%) ~ 11.70s 11.83s p=0.420 n=6
Emit Time 3.45s (± 4.77%) 3.48s (± 4.28%) ~ 3.26s 3.65s p=0.574 n=6
Total Time 17.65s (± 0.71%) 17.72s (± 0.67%) ~ 17.56s 17.87s p=0.378 n=6
angular-1 - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 955,117 955,117 ~ ~ ~ p=1.000 n=6
Types 415,619 415,619 ~ ~ ~ p=1.000 n=6
Memory used 1,254,733k (± 0.01%) 1,254,752k (± 0.01%) ~ 1,254,622k 1,254,866k p=0.689 n=6
Parse Time 7.98s (± 0.91%) 8.00s (± 0.98%) ~ 7.90s 8.10s p=0.748 n=6
Bind Time 2.28s (± 0.48%) 2.29s (± 0.71%) ~ 2.26s 2.31s p=0.324 n=6
Check Time 38.57s (± 0.30%) 38.70s (± 0.36%) ~ 38.44s 38.81s p=0.109 n=6
Emit Time 17.84s (± 0.33%) 17.93s (± 0.45%) ~ 17.85s 18.05s p=0.092 n=6
Total Time 66.67s (± 0.22%) 66.92s (± 0.18%) +0.25s (+ 0.37%) 66.71s 67.04s p=0.020 n=6
mui-docs - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 554,936 554,936 ~ ~ ~ p=1.000 n=6
Types 89 89 ~ ~ ~ p=1.000 n=6
Memory used 832,086k (± 0.00%) 832,082k (± 0.00%) ~ 832,046k 832,101k p=1.000 n=6
Parse Time 10.53s (± 0.49%) 10.52s (± 0.48%) ~ 10.44s 10.60s p=0.360 n=6
Bind Time 2.68s (± 0.91%) 2.67s (± 0.87%) ~ 2.63s 2.70s p=0.418 n=6
Check Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Emit Time 0.34s (± 3.13%) 0.34s (± 1.53%) ~ 0.33s 0.34s p=0.794 n=6
Total Time 13.55s (± 0.49%) 13.52s (± 0.41%) ~ 13.44s 13.60s p=0.470 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,237,224 1,237,228 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 259,862 259,864 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,974,215k (±10.00%) 3,095,194k (± 0.03%) ~ 3,094,048k 3,096,638k p=0.810 n=6
Parse Time 6.61s (± 1.39%) 6.65s (± 0.58%) ~ 6.60s 6.70s p=0.336 n=6
Bind Time 2.15s (± 1.58%) 2.13s (± 1.05%) ~ 2.10s 2.16s p=0.377 n=6
Check Time 42.29s (± 0.54%) 42.54s (± 0.26%) +0.25s (+ 0.59%) 42.39s 42.67s p=0.020 n=6
Emit Time 3.49s (± 2.69%) 3.49s (± 1.57%) ~ 3.40s 3.54s p=0.748 n=6
Total Time 54.53s (± 0.43%) 54.81s (± 0.32%) +0.27s (+ 0.50%) 54.51s 54.98s p=0.045 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,237,224 1,237,228 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 259,862 259,864 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,158,935k (± 0.02%) 3,038,463k (± 9.72%) ~ 2,434,764k 3,160,049k p=0.575 n=6
Parse Time 6.85s (± 1.13%) 6.80s (± 1.64%) ~ 6.60s 6.93s p=0.689 n=6
Bind Time 2.15s (± 2.30%) 2.17s (± 1.36%) ~ 2.12s 2.20s p=0.630 n=6
Check Time 42.66s (± 0.26%) 42.68s (± 0.66%) ~ 42.16s 42.98s p=0.575 n=6
Emit Time 3.53s (± 2.61%) 3.57s (± 1.84%) ~ 3.44s 3.62s p=0.575 n=6
Total Time 55.19s (± 0.35%) 55.23s (± 0.64%) ~ 54.52s 55.46s p=0.378 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,502 262,506 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 104,038 104,040 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 440,640k (± 0.02%) 440,670k (± 0.01%) ~ 440,642k 440,715k p=0.298 n=6
Parse Time 3.50s (± 1.04%) 3.50s (± 0.61%) ~ 3.47s 3.53s p=0.466 n=6
Bind Time 1.32s (± 0.62%) 1.32s (± 1.31%) ~ 1.29s 1.34s p=0.677 n=6
Check Time 18.95s (± 0.26%) 18.96s (± 0.55%) ~ 18.86s 19.11s p=0.687 n=6
Emit Time 1.52s (± 0.90%) 1.52s (± 1.10%) ~ 1.50s 1.54s p=0.511 n=6
Total Time 25.30s (± 0.17%) 25.29s (± 0.34%) ~ 25.20s 25.42s p=0.748 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 72 72 ~ ~ ~ p=1.000 n=6
Symbols 225,374 225,374 ~ ~ ~ p=1.000 n=6
Types 94,297 94,297 ~ ~ ~ p=1.000 n=6
Memory used 369,993k (± 0.01%) 370,125k (± 0.03%) +133k (+ 0.04%) 369,935k 370,250k p=0.045 n=6
Parse Time 2.80s (± 0.95%) 2.82s (± 0.86%) ~ 2.79s 2.85s p=0.291 n=6
Bind Time 1.61s (± 1.56%) 1.61s (± 1.45%) ~ 1.60s 1.66s p=0.454 n=6
Check Time 16.48s (± 0.40%) 16.52s (± 0.53%) ~ 16.42s 16.66s p=0.688 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.90s (± 0.28%) 20.96s (± 0.49%) ~ 20.81s 21.11s p=0.295 n=6
vscode - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 3,984,901 3,984,901 ~ ~ ~ p=1.000 n=6
Types 1,249,994 1,249,994 ~ ~ ~ p=1.000 n=6
Memory used 3,768,860k (± 0.00%) 3,768,782k (± 0.00%) ~ 3,768,557k 3,769,056k p=0.471 n=6
Parse Time 15.35s (± 0.45%) 15.32s (± 0.37%) ~ 15.24s 15.41s p=0.521 n=6
Bind Time 4.98s (± 0.41%) 5.01s (± 0.66%) ~ 4.97s 5.07s p=0.107 n=6
Check Time 103.30s (± 2.10%) 101.87s (± 0.22%) ~ 101.59s 102.19s p=0.378 n=6
Emit Time 39.64s (± 9.49%) 38.37s (± 0.80%) ~ 38.09s 38.94s p=1.000 n=6
Total Time 163.27s (± 2.60%) 160.56s (± 0.23%) ~ 160.05s 161.03s p=0.378 n=6
webpack - node (v18.15.0, x64)
Errors 40 40 ~ ~ ~ p=1.000 n=6
Symbols 373,618 373,618 ~ ~ ~ p=1.000 n=6
Types 163,475 163,475 ~ ~ ~ p=1.000 n=6
Memory used 530,175k (± 0.02%) 530,146k (± 0.03%) ~ 529,980k 530,416k p=0.575 n=6
Parse Time 4.54s (± 0.55%) 4.55s (± 0.95%) ~ 4.50s 4.61s p=0.685 n=6
Bind Time 1.97s (± 1.16%) 1.93s (± 1.73%) -0.04s (- 2.03%) 1.89s 1.99s p=0.034 n=6
Check Time 22.15s (± 0.41%) 22.15s (± 0.24%) ~ 22.07s 22.20s p=0.748 n=6
Emit Time 0.00s 0.00s (±154.76%) ~ 0.00s 0.01s p=0.174 n=6
Total Time 28.66s (± 0.36%) 28.64s (± 0.31%) ~ 28.53s 28.74s p=0.688 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 676,692 676,692 ~ ~ ~ p=1.000 n=6
Types 203,798 203,798 ~ ~ ~ p=1.000 n=6
Memory used 578,339k (± 0.01%) 578,385k (± 0.02%) ~ 578,339k 578,566k p=0.471 n=6
Parse Time 3.35s (± 0.52%) 3.36s (± 0.31%) ~ 3.35s 3.38s p=0.101 n=6
Bind Time 1.14s (± 0.36%) 1.14s (± 0.55%) ~ 1.13s 1.15s p=0.673 n=6
Check Time 17.63s (± 0.89%) 17.68s (± 2.12%) ~ 16.92s 17.92s p=0.173 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.11s (± 0.73%) 22.18s (± 1.70%) ~ 21.42s 22.43s p=0.125 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,285ms (± 0.88%) 2,287ms (± 0.68%) ~ 2,269ms 2,307ms p=0.873 n=6
Req 2 - geterr 5,356ms (± 0.52%) 5,365ms (± 0.45%) ~ 5,330ms 5,402ms p=0.630 n=6
Req 3 - references 267ms (± 1.92%) 266ms (± 1.62%) ~ 260ms 270ms p=1.000 n=6
Req 4 - navto 218ms (± 0.75%) 221ms (± 2.83%) ~ 216ms 233ms p=0.459 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 76ms (± 3.15%) 76ms (± 2.69%) ~ 75ms 80ms p=0.599 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,406ms (± 0.56%) 2,409ms (± 0.59%) ~ 2,393ms 2,432ms p=0.630 n=6
Req 2 - geterr 3,997ms (± 0.49%) 4,007ms (± 0.37%) ~ 3,994ms 4,033ms p=0.128 n=6
Req 3 - references 279ms (± 1.33%) 278ms (± 1.22%) ~ 275ms 282ms p=0.287 n=6
Req 4 - navto 223ms (± 0.25%) 223ms (± 0.38%) ~ 222ms 224ms p=0.855 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 82ms (± 7.61%) 81ms (± 6.72%) ~ 76ms 87ms p=0.727 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 6,434ms (± 0.70%) 6,431ms (± 0.51%) ~ 6,389ms 6,470ms p=1.000 n=6
Req 2 - geterr 1,582ms (±10.76%) 1,580ms (±10.56%) ~ 1,357ms 1,709ms p=1.000 n=6
Req 3 - references 125ms (± 6.91%) 126ms (± 8.47%) ~ 104ms 131ms p=0.686 n=6
Req 4 - navto 589ms (± 8.28%) 586ms (± 5.65%) ~ 522ms 611ms p=0.689 n=6
Req 5 - completionInfo count 3,487 3,487 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 1,254ms (± 2.00%) 1,209ms (± 7.53%) ~ 1,024ms 1,265ms p=0.521 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 158.26ms (± 0.23%) 159.10ms (± 0.14%) +0.83ms (+ 0.53%) 158.00ms 163.78ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 232.77ms (± 0.16%) 232.65ms (± 0.15%) -0.12ms (- 0.05%) 231.14ms 236.72ms p=0.002 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 229.49ms (± 0.16%) 229.18ms (± 0.15%) -0.31ms (- 0.14%) 227.71ms 233.60ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 228.52ms (± 0.18%) 228.39ms (± 0.17%) -0.13ms (- 0.06%) 226.92ms 235.60ms p=0.002 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

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.

Abstract classes will still import the value for a computed property at runtime

3 participants