Skip to content

Conversation

ahejlsberg
Copy link
Member

@Copilot Copilot AI review requested due to automatic review settings September 28, 2025 15:24
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Sep 28, 2025
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 28, 2025
Copy link

@Copilot 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 ports changes from typescript-go repository pull request #1759, focusing on improving type checking behavior for object literal types and updating test baselines accordingly.

  • Updates type checking logic for fresh literal types to use object flags instead of type checking
  • Removes redundant undefined type checking for source properties
  • Updates test baseline to reflect more precise type information

Reviewed Changes

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

File Description
src/compiler/checker.ts Refactors object literal type checking to use ObjectFlags.FreshLiteral and removes unnecessary undefined checking
tests/baselines/reference/jsDeclarationsFunctionClassesCjsExportAssignment.js Updates baseline to show State type instead of any for the state property
Comments suppressed due to low confidence (1)

src/compiler/checker.ts:1

  • The removal of the undefined type check may cause incorrect behavior. Previously, properties with undefined types were allowed to not exist on the target type, but now all source properties must exist on the target regardless of their type. This could break valid TypeScript code where optional properties are involved.
import {

@ahejlsberg
Copy link
Member Author

Not sure why the .d.ts emit changed, though looks it actually improved.

@ahejlsberg
Copy link
Member Author

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 28, 2025

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

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the user tests with tsc comparing main and refs/pull/62502/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

@ahejlsberg
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 193,972k (± 0.95%) 193,385k (± 0.77%) ~ 192,750k 196,432k p=0.873 n=6
Parse Time 1.30s (± 0.76%) 1.30s (± 0.49%) ~ 1.29s 1.31s p=0.733 n=6
Bind Time 0.72s (± 0.57%) 0.72s ~ ~ ~ p=0.405 n=6
Check Time 9.73s (± 0.30%) 9.72s (± 0.26%) ~ 9.69s 9.75s p=0.809 n=6
Emit Time 2.76s (± 0.55%) 2.74s (± 0.46%) ~ 2.73s 2.76s p=0.101 n=6
Total Time 14.50s (± 0.21%) 14.49s (± 0.24%) ~ 14.43s 14.53s p=0.421 n=6
angular-1 - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 948,914 948,914 ~ ~ ~ p=1.000 n=6
Types 410,884 410,884 ~ ~ ~ p=1.000 n=6
Memory used 1,245,586k (± 0.00%) 1,245,619k (± 0.00%) ~ 1,245,569k 1,245,682k p=0.173 n=6
Parse Time 6.53s (± 0.69%) 6.48s (± 0.43%) ~ 6.45s 6.53s p=0.065 n=6
Bind Time 1.88s (± 0.27%) 1.87s (± 0.44%) ~ 1.86s 1.88s p=0.523 n=6
Check Time 32.23s (± 0.24%) 32.16s (± 0.33%) ~ 32.03s 32.30s p=0.258 n=6
Emit Time 14.79s (± 0.22%) 14.82s (± 0.32%) ~ 14.74s 14.86s p=0.198 n=6
Total Time 55.42s (± 0.14%) 55.34s (± 0.25%) ~ 55.15s 55.49s p=0.261 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,544,632 2,544,632 ~ ~ ~ p=1.000 n=6
Types 903,208 903,208 ~ ~ ~ p=1.000 n=6
Memory used 2,829,801k (± 0.00%) 2,829,938k (± 0.00%) ~ 2,829,698k 2,830,075k p=0.066 n=6
Parse Time 8.71s (± 0.35%) 8.74s (± 0.63%) ~ 8.67s 8.82s p=0.260 n=6
Bind Time 2.19s (± 0.25%) 2.20s (± 0.48%) ~ 2.18s 2.21s p=1.000 n=6
Check Time 86.94s (± 1.21%) 86.69s (± 1.33%) ~ 85.90s 88.57s p=0.936 n=6
Emit Time 0.63s (±125.53%) 0.31s (± 1.68%) ~ 0.30s 0.31s p=0.784 n=6
Total Time 98.46s (± 1.21%) 97.93s (± 1.19%) ~ 97.13s 99.88s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,237,064 1,237,063 -1 (- 0.00%) ~ ~ p=0.001 n=6
Types 259,743 259,743 ~ ~ ~ p=1.000 n=6
Memory used 2,364,574k (± 0.02%) 2,424,816k (± 6.11%) ~ 2,363,837k 2,727,636k p=0.810 n=6
Parse Time 5.14s (± 1.32%) 5.16s (± 1.22%) ~ 5.05s 5.22s p=0.689 n=6
Bind Time 1.77s (± 0.87%) 1.80s (± 1.72%) +0.03s (+ 1.69%) 1.77s 1.85s p=0.040 n=6
Check Time 35.15s (± 0.12%) 34.91s (± 0.63%) -0.24s (- 0.68%) 34.48s 35.07s p=0.005 n=6
Emit Time 2.99s (± 1.32%) 3.01s (± 0.30%) ~ 3.00s 3.02s p=0.078 n=6
Total Time 45.07s (± 0.23%) 44.89s (± 0.46%) ~ 44.51s 45.05s p=0.066 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,237,064 1,237,063 -1 (- 0.00%) ~ ~ p=0.001 n=6
Types 259,743 259,743 ~ ~ ~ p=1.000 n=6
Memory used 3,158,503k (± 0.01%) 3,157,640k (± 0.02%) -863k (- 0.03%) 3,156,827k 3,158,454k p=0.045 n=6
Parse Time 6.89s (± 0.57%) 6.87s (± 0.77%) ~ 6.82s 6.94s p=0.378 n=6
Bind Time 2.16s (± 0.91%) 2.15s (± 0.93%) ~ 2.12s 2.18s p=0.225 n=6
Check Time 42.56s (± 0.06%) 42.56s (± 0.25%) ~ 42.44s 42.71s p=1.000 n=6
Emit Time 3.50s (± 3.38%) 3.59s (± 1.55%) ~ 3.52s 3.69s p=0.226 n=6
Total Time 55.11s (± 0.27%) 55.17s (± 0.26%) ~ 55.01s 55.38s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,412 262,411 -1 (- 0.00%) ~ ~ p=0.001 n=6
Types 103,924 103,924 ~ ~ ~ p=1.000 n=6
Memory used 440,422k (± 0.01%) 440,471k (± 0.01%) ~ 440,393k 440,563k p=0.230 n=6
Parse Time 3.46s (± 0.96%) 3.51s (± 1.14%) ~ 3.46s 3.58s p=0.077 n=6
Bind Time 1.31s (± 1.12%) 1.32s (± 0.78%) ~ 1.31s 1.34s p=0.211 n=6
Check Time 18.99s (± 0.27%) 18.93s (± 0.51%) ~ 18.85s 19.10s p=0.172 n=6
Emit Time 1.53s (± 0.76%) 1.52s (± 1.07%) ~ 1.50s 1.54s p=0.462 n=6
Total Time 25.30s (± 0.31%) 25.29s (± 0.38%) ~ 25.21s 25.47s p=0.575 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 72 72 ~ ~ ~ p=1.000 n=6
Symbols 225,367 225,367 ~ ~ ~ p=1.000 n=6
Types 94,290 94,290 ~ ~ ~ p=1.000 n=6
Memory used 370,111k (± 0.06%) 370,069k (± 0.06%) ~ 369,867k 370,393k p=0.810 n=6
Parse Time 2.83s (± 1.17%) 2.82s (± 1.26%) ~ 2.78s 2.87s p=0.573 n=6
Bind Time 1.60s (± 1.46%) 1.60s (± 1.55%) ~ 1.57s 1.64s p=0.808 n=6
Check Time 16.44s (± 0.51%) 16.49s (± 0.39%) ~ 16.40s 16.54s p=0.261 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.88s (± 0.47%) 20.91s (± 0.25%) ~ 20.81s 20.95s p=0.261 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,890,940 3,890,942 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 1,224,250 1,224,251 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,704,567k (± 0.01%) 3,704,494k (± 0.00%) ~ 3,704,345k 3,704,657k p=0.471 n=6
Parse Time 15.44s (± 3.27%) 15.24s (± 0.60%) ~ 15.13s 15.36s p=0.689 n=6
Bind Time 4.94s (± 0.56%) 4.95s (± 0.56%) ~ 4.91s 4.99s p=0.683 n=6
Check Time 102.07s (± 1.15%) 101.51s (± 1.30%) ~ 100.50s 103.25s p=0.298 n=6
Emit Time 34.07s (±14.93%) 36.00s (±16.98%) ~ 30.83s 46.36s p=0.298 n=6
Total Time 156.51s (± 3.52%) 157.69s (± 4.15%) ~ 151.62s 167.21s p=1.000 n=6
webpack - node (v18.15.0, x64)
Errors 38 38 ~ ~ ~ p=1.000 n=6
Symbols 361,753 361,753 ~ ~ ~ p=1.000 n=6
Types 158,862 158,862 ~ ~ ~ p=1.000 n=6
Memory used 516,484k (± 0.02%) 516,495k (± 0.02%) ~ 516,397k 516,644k p=0.936 n=6
Parse Time 4.47s (± 0.72%) 4.44s (± 0.60%) ~ 4.40s 4.47s p=0.466 n=6
Bind Time 1.91s (± 1.13%) 1.91s (± 0.72%) ~ 1.89s 1.92s p=0.514 n=6
Check Time 21.87s (± 0.26%) 21.82s (± 0.29%) ~ 21.71s 21.88s p=0.377 n=6
Emit Time 0.00s 0.00s (±154.76%) ~ 0.00s 0.01s p=0.174 n=6
Total Time 28.25s (± 0.19%) 28.18s (± 0.32%) ~ 28.01s 28.27s p=0.076 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 672,790 672,790 ~ ~ ~ p=1.000 n=6
Types 201,962 201,962 ~ ~ ~ p=1.000 n=6
Memory used 574,862k (± 0.02%) 574,960k (± 0.03%) ~ 574,701k 575,140k p=0.230 n=6
Parse Time 4.17s (± 0.86%) 4.17s (± 1.29%) ~ 4.13s 4.27s p=0.872 n=6
Bind Time 1.33s (± 0.61%) 1.33s (± 0.63%) ~ 1.31s 1.33s p=0.120 n=6
Check Time 20.57s (± 1.88%) 20.46s (± 1.71%) ~ 20.12s 20.95s p=0.688 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.07s (± 1.44%) 25.96s (± 1.38%) ~ 25.60s 26.46s p=0.630 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

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

Everything looks good!

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Sep 28, 2025
@ahejlsberg ahejlsberg enabled auto-merge (squash) September 28, 2025 20:55
@ahejlsberg ahejlsberg merged commit 1cd5309 into main Sep 28, 2025
33 checks passed
@ahejlsberg ahejlsberg deleted the port-tsgo-1759 branch September 28, 2025 20:55
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Sep 28, 2025
@imbant
Copy link

imbant commented Sep 29, 2025

Looks like Strada’s code is already being back-ported to Corsa. Interesting.

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

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants