Skip to content

Conversation

@weswigham
Copy link
Member

Since those type parameters are reachable anywhere in the body of the class, not just the constructor itself.

Honestly, we could always do the getImplementationSignature call, it doesn't have to be conditional, but we like trying to cut down on the type parameter copying we do, where possible. And certainly, as long as you only ever use the signature externally to the scope within which its' type parameters are internally reachable, you don't need to copy it.

Fixes#58074

Copy link
Member

@jakebaileyjakebailey left a comment

Choose a reason for hiding this comment

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 12, 2024

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

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

@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.

@MichaelMitchell-at
Copy link
Contributor

Hm, the repro I provided in #58158 is fixed now, but I'm still seeing the issue in our codebase. I'll have to update the repro to more closely resemble our actual code.

@typescript-bot
Copy link
Collaborator

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

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
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,951k (± 0.01%)295,923k (± 0.01%)~295,887k295,978kp=0.336 n=6
Parse Time2.66s (± 0.84%)2.66s (± 0.46%)~2.64s2.67sp=0.935 n=6
Bind Time0.82s (± 1.48%)0.83s (± 1.65%)~0.81s0.84sp=0.262 n=6
Check Time8.26s (± 0.45%)8.25s (± 0.49%)~8.18s8.29sp=0.871 n=6
Emit Time7.09s (± 0.55%)7.07s (± 0.31%)~7.04s7.10sp=0.573 n=6
Total Time18.82s (± 0.49%)18.80s (± 0.29%)~18.71s18.88sp=1.000 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used192,850k (± 0.96%)192,269k (± 0.75%)~191,633k195,216kp=0.689 n=6
Parse Time1.37s (± 1.07%)1.36s (± 0.76%)~1.35s1.38sp=0.345 n=6
Bind Time0.72s (± 0.57%)0.72s (± 0.00%)~0.72s0.72sp=0.405 n=6
Check Time9.42s (± 0.40%)9.44s (± 0.21%)~9.41s9.46sp=0.687 n=6
Emit Time2.62s (± 0.78%)2.62s (± 0.46%)~2.61s2.64sp=0.871 n=6
Total Time14.14s (± 0.35%)14.14s (± 0.08%)~14.12s14.15sp=0.934 n=6
Monaco - node (v18.15.0, x64)
Memory used347,732k (± 0.01%)347,731k (± 0.01%)~347,710k347,781kp=0.748 n=6
Parse Time2.48s (± 0.55%)2.49s (± 0.22%)~2.48s2.49sp=0.663 n=6
Bind Time0.89s (± 0.00%)0.89s (± 0.00%)~0.89s0.89sp=1.000 n=6
Check Time6.98s (± 0.26%)6.98s (± 0.47%)~6.94s7.03sp=0.686 n=6
Emit Time4.06s (± 0.25%)4.07s (± 0.42%)~4.04s4.09sp=0.459 n=6
Total Time14.42s (± 0.23%)14.43s (± 0.23%)~14.40s14.48sp=1.000 n=6
TFS - node (v18.15.0, x64)
Memory used302,604k (± 0.01%)302,612k (± 0.01%)~302,581k302,644kp=0.689 n=6
Parse Time2.96s (± 0.92%)2.98s (± 0.87%)~2.95s3.02sp=0.517 n=6
Bind Time1.44s (± 0.57%)1.44s (± 0.36%)~1.43s1.44sp=0.929 n=6
Check Time9.16s (± 0.41%)9.19s (± 0.38%)~9.15s9.24sp=0.260 n=6
Emit Time5.30s (± 0.40%)5.34s (± 0.66%)~5.31s5.40sp=0.053 n=6
Total Time18.85s (± 0.27%)18.94s (± 0.29%)+0.09s (+ 0.45%)18.87s19.01sp=0.037 n=6
material-ui - node (v18.15.0, x64)
Memory used510,595k (± 0.01%)510,579k (± 0.01%)~510,526k510,623kp=0.575 n=6
Parse Time2.67s (± 0.51%)2.65s (± 0.65%)~2.63s2.67sp=0.209 n=6
Bind Time0.99s (± 1.49%)0.99s (± 0.76%)~0.98s1.00sp=0.934 n=6
Check Time17.21s (± 0.38%)17.19s (± 0.34%)~17.10s17.26sp=0.872 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.87s (± 0.30%)20.82s (± 0.27%)~20.74s20.88sp=0.572 n=6
mui-docs - node (v18.15.0, x64)
Memory used1,742,814k (± 0.00%)1,742,787k (± 0.00%)~1,742,753k1,742,819kp=0.298 n=6
Parse Time9.68s (± 0.75%)9.68s (± 0.72%)~9.57s9.76sp=1.000 n=6
Bind Time3.38s (± 0.98%)3.41s (± 0.94%)~3.36s3.45sp=0.147 n=6
Check Time81.44s (± 0.30%)81.16s (± 0.52%)~80.70s81.89sp=0.173 n=6
Emit Time0.19s (± 2.13%)0.19s (± 0.00%)~0.19s0.19sp=0.405 n=6
Total Time94.70s (± 0.24%)94.44s (± 0.43%)~94.07s95.18sp=0.230 n=6
self-build-src - node (v18.15.0, x64)
Memory used2,302,177k (± 0.02%)2,302,266k (± 0.03%)~2,301,556k2,303,440kp=0.936 n=6
Parse Time7.38s (± 0.69%)7.35s (± 0.96%)~7.28s7.47sp=0.378 n=6
Bind Time2.73s (± 0.88%)2.74s (± 1.45%)~2.70s2.80sp=0.936 n=6
Check Time48.93s (± 0.43%)49.08s (± 0.35%)~48.90s49.39sp=0.128 n=6
Emit Time3.86s (± 2.59%)3.83s (± 2.34%)~3.69s3.92sp=0.521 n=6
Total Time62.90s (± 0.41%)63.01s (± 0.40%)~62.67s63.33sp=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Memory used2,376,666k (± 0.03%)2,377,204k (± 0.03%)~2,376,384k2,377,994kp=0.471 n=6
Parse Time7.62s (± 0.53%)7.69s (± 0.88%)~7.62s7.78sp=0.093 n=6
Bind Time2.50s (± 1.00%)2.49s (± 1.12%)~2.45s2.52sp=0.936 n=6
Check Time49.33s (± 0.49%)49.26s (± 0.18%)~49.12s49.35sp=0.810 n=6
Emit Time3.92s (± 1.98%)3.96s (± 4.42%)~3.79s4.28sp=0.936 n=6
Total Time63.38s (± 0.33%)63.42s (± 0.49%)~63.09s63.94sp=1.000 n=6
self-compiler - node (v18.15.0, x64)
Memory used418,429k (± 0.01%)418,459k (± 0.01%)~418,424k418,520kp=0.229 n=6
Parse Time3.38s (± 1.02%)3.39s (± 0.81%)~3.36s3.43sp=0.572 n=6
Bind Time1.30s (± 0.97%)1.31s (± 1.74%)~1.28s1.35sp=0.459 n=6
Check Time17.93s (± 0.10%)17.91s (± 0.38%)~17.83s18.02sp=0.377 n=6
Emit Time1.39s (± 1.56%)1.37s (± 1.34%)~1.34s1.39sp=0.256 n=6
Total Time23.99s (± 0.16%)23.98s (± 0.24%)~23.92s24.06sp=0.687 n=6
vscode - node (v18.15.0, x64)
Memory used2,907,744k (± 0.00%)2,907,821k (± 0.00%)+78k (+ 0.00%)2,907,761k2,907,876kp=0.013 n=6
Parse Time12.97s (± 0.27%)12.96s (± 0.28%)~12.92s13.02sp=0.467 n=6
Bind Time4.07s (± 0.18%)4.07s (± 0.30%)~4.05s4.08sp=0.867 n=6
Check Time71.37s (± 0.46%)71.63s (± 0.50%)~71.32s72.24sp=0.230 n=6
Emit Time19.49s (± 0.89%)19.28s (± 0.47%)-0.21s (- 1.10%)19.13s19.40sp=0.031 n=6
Total Time107.90s (± 0.45%)107.93s (± 0.37%)~107.59s108.65sp=1.000 n=6
webpack - node (v18.15.0, x64)
Memory used408,864k (± 0.02%)408,885k (± 0.04%)~408,708k409,108kp=1.000 n=6
Parse Time4.77s (± 0.61%)4.78s (± 0.73%)~4.74s4.83sp=0.800 n=6
Bind Time2.04s (± 0.86%)2.04s (± 0.80%)~2.02s2.06sp=1.000 n=6
Check Time20.73s (± 0.27%)20.78s (± 0.35%)~20.67s20.90sp=0.199 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time27.54s (± 0.27%)27.60s (± 0.32%)~27.52s27.76sp=0.108 n=6
xstate - node (v18.15.0, x64)
Memory used670,808k (± 0.01%)670,889k (± 0.01%)+81k (+ 0.01%)670,841k670,962kp=0.008 n=6
Parse Time4.05s (± 0.13%)4.02s (± 0.48%)-0.02s (- 0.62%)4.00s4.05sp=0.036 n=6
Bind Time1.89s (± 0.99%)1.88s (± 0.99%)~1.86s1.90sp=0.459 n=6
Check Time3.42s (± 0.48%)3.44s (± 0.47%)+0.03s (+ 0.78%)3.42s3.46sp=0.036 n=6
Emit Time0.03s (±21.89%)0.02s (±21.89%)~0.02s0.03sp=1.000 n=6
Total Time9.39s (± 0.21%)9.38s (± 0.35%)~9.34s9.43sp=0.566 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-build-src-public-api - 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@MichaelMitchell-at
Copy link
Contributor

MichaelMitchell-at commented Apr 12, 2024

@weswigham here's another regressed case that doesn't yet pass

typeAssign<T,U>=Omit<T,keyofU>&U;classBase<T>{constructor(publict: T){}}exportclassFoo<T>extendsBase<T>{update(): Foo<Assign<T,{x: number}>>{constv: Assign<T,{x: number}>=Object.assign(this.t,{x: 1});returnnewFoo(v);}}

@weswigham
Copy link
MemberAuthor

@MichaelMitchell-at handled~

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 12, 2024

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

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

@MichaelMitchell-at
Copy link
Contributor

Nice, that did the trick, thank you

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the user tests comparing main and refs/pull/58168/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,915k (± 0.01%)295,955k (± 0.01%)+40k (+ 0.01%)295,922k295,983kp=0.045 n=6
Parse Time2.66s (± 0.15%)2.66s (± 0.55%)~2.63s2.67sp=0.445 n=6
Bind Time0.83s (± 1.41%)0.82s (± 1.62%)~0.81s0.84sp=0.206 n=6
Check Time8.23s (± 0.37%)8.23s (± 0.40%)~8.18s8.26sp=0.572 n=6
Emit Time7.07s (± 0.38%)7.05s (± 0.53%)~7.02s7.12sp=0.373 n=6
Total Time18.78s (± 0.12%)18.77s (± 0.14%)~18.75s18.82sp=0.219 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used193,464k (± 1.02%)191,593k (± 0.01%)-1,871k (- 0.97%)191,563k191,626kp=0.013 n=6
Parse Time2.03s (± 1.14%)2.03s (± 1.57%)~2.00s2.09sp=0.935 n=6
Bind Time1.06s (± 0.93%)1.06s (± 1.14%)~1.05s1.08sp=0.498 n=6
Check Time13.87s (± 0.63%)13.85s (± 0.52%)~13.77s13.96sp=0.936 n=6
Emit Time3.85s (± 0.66%)3.86s (± 0.78%)~3.82s3.90sp=0.935 n=6
Total Time20.81s (± 0.35%)20.81s (± 0.42%)~20.69s20.91sp=1.000 n=6
Monaco - node (v18.15.0, x64)
Memory used347,757k (± 0.01%)347,752k (± 0.00%)~347,737k347,772kp=0.936 n=6
Parse Time3.69s (± 0.93%)3.69s (± 1.74%)~3.57s3.76sp=1.000 n=6
Bind Time1.32s (± 1.51%)1.33s (± 1.88%)~1.32s1.38sp=0.413 n=6
Check Time10.14s (± 0.43%)10.13s (± 0.51%)~10.04s10.17sp=0.747 n=6
Emit Time6.03s (± 0.77%)6.01s (± 0.35%)~5.98s6.03sp=0.373 n=6
Total Time21.18s (± 0.37%)21.16s (± 0.35%)~21.09s21.29sp=0.468 n=6
TFS - node (v18.15.0, x64)
Memory used302,624k (± 0.01%)302,620k (± 0.01%)~302,597k302,646kp=1.000 n=6
Parse Time2.41s (± 1.25%)2.40s (± 0.78%)~2.37s2.42sp=0.514 n=6
Bind Time1.18s (± 1.90%)1.16s (± 1.67%)~1.15s1.20sp=0.155 n=6
Check Time7.44s (± 0.32%)7.46s (± 0.43%)~7.42s7.50sp=0.406 n=6
Emit Time4.27s (± 0.70%)4.26s (± 0.53%)~4.23s4.30sp=0.325 n=6
Total Time15.30s (± 0.36%)15.29s (± 0.44%)~15.17s15.37sp=0.809 n=6
material-ui - node (v18.15.0, x64)
Memory used510,655k (± 0.00%)510,648k (± 0.01%)~510,596k510,703kp=0.810 n=6
Parse Time3.95s (± 0.77%)3.96s (± 0.53%)~3.94s4.00sp=0.624 n=6
Bind Time1.46s (± 0.52%)1.45s (± 0.81%)~1.43s1.46sp=0.150 n=6
Check Time25.35s (± 0.34%)25.31s (± 0.16%)~25.26s25.35sp=0.294 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time30.76s (± 0.24%)30.71s (± 0.13%)~30.65s30.76sp=0.227 n=6
mui-docs - node (v18.15.0, x64)
Memory used1,742,770k (± 0.00%)1,742,771k (± 0.00%)~1,742,732k1,742,801kp=0.689 n=6
Parse Time7.86s (± 0.88%)7.85s (± 0.70%)~7.79s7.95sp=0.936 n=6
Bind Time2.74s (± 0.96%)2.77s (± 1.36%)~2.71s2.82sp=0.147 n=6
Check Time66.39s (± 0.29%)66.42s (± 0.39%)~66.09s66.85sp=1.000 n=6
Emit Time0.16s (± 0.00%)0.16s (± 3.29%)~0.15s0.16sp=0.174 n=6
Total Time77.15s (± 0.30%)77.21s (± 0.36%)~76.91s77.67sp=1.000 n=6
self-build-src - node (v18.15.0, x64)
Memory used2,303,779k (± 0.05%)2,303,271k (± 0.04%)~2,302,144k2,304,536kp=0.471 n=6
Parse Time7.39s (± 0.64%)7.36s (± 1.25%)~7.27s7.54sp=0.261 n=6
Bind Time2.75s (± 0.93%)2.75s (± 1.55%)~2.67s2.79sp=0.571 n=6
Check Time48.81s (± 0.40%)48.97s (± 0.55%)~48.66s49.46sp=0.471 n=6
Emit Time3.92s (± 2.96%)3.85s (± 2.61%)~3.73s4.00sp=0.470 n=6
Total Time62.89s (± 0.46%)62.95s (± 0.54%)~62.54s63.45sp=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Memory used2,378,401k (± 0.05%)2,378,079k (± 0.03%)~2,376,941k2,379,012kp=0.471 n=6
Parse Time6.18s (± 0.83%)6.14s (± 0.61%)~6.10s6.19sp=0.128 n=6
Bind Time2.03s (± 1.06%)2.05s (± 1.14%)~2.02s2.08sp=0.142 n=6
Check Time39.82s (± 0.32%)40.01s (± 0.45%)+0.18s (+ 0.46%)39.66s40.17sp=0.045 n=6
Emit Time3.13s (± 1.94%)3.14s (± 1.77%)~3.07s3.20sp=0.810 n=6
Total Time51.19s (± 0.32%)51.37s (± 0.39%)~51.06s51.65sp=0.298 n=6
self-compiler - node (v18.15.0, x64)
Memory used418,356k (± 0.01%)418,409k (± 0.01%)~418,382k418,447kp=0.109 n=6
Parse Time4.18s (± 0.52%)4.17s (± 0.28%)~4.15s4.18sp=0.193 n=6
Bind Time1.59s (± 1.90%)1.60s (± 1.84%)~1.55s1.63sp=0.571 n=6
Check Time22.08s (± 0.35%)22.14s (± 0.44%)~22.03s22.24sp=0.298 n=6
Emit Time1.69s (± 1.35%)1.70s (± 1.18%)~1.67s1.73sp=0.370 n=6
Total Time29.53s (± 0.37%)29.60s (± 0.39%)~29.46s29.71sp=0.297 n=6
vscode - node (v18.15.0, x64)
Memory used2,907,801k (± 0.00%)2,907,818k (± 0.00%)~2,907,757k2,907,860kp=0.470 n=6
Parse Time10.88s (± 0.17%)10.89s (± 0.29%)~10.85s10.94sp=0.935 n=6
Bind Time3.40s (± 0.44%)3.39s (± 0.26%)~3.38s3.40sp=0.084 n=6
Check Time61.53s (± 0.21%)61.69s (± 0.36%)~61.47s62.02sp=0.229 n=6
Emit Time16.50s (± 0.61%)16.45s (± 0.63%)~16.26s16.54sp=0.936 n=6
Total Time92.31s (± 0.19%)92.42s (± 0.23%)~92.18s92.78sp=0.575 n=6
webpack - node (v18.15.0, x64)
Memory used408,750k (± 0.01%)408,749k (± 0.02%)~408,632k408,821kp=1.000 n=6
Parse Time3.23s (± 0.41%)3.22s (± 0.31%)~3.21s3.23sp=0.185 n=6
Bind Time1.39s (± 0.37%)1.39s (± 0.00%)~1.39s1.39sp=0.174 n=6
Check Time14.18s (± 0.23%)14.24s (± 0.38%)~14.16s14.32sp=0.091 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time18.80s (± 0.19%)18.84s (± 0.27%)~18.76s18.91sp=0.126 n=6
xstate - node (v18.15.0, x64)
Memory used670,804k (± 0.01%)670,937k (± 0.01%)+133k (+ 0.02%)670,836k671,000kp=0.020 n=6
Parse Time4.03s (± 0.70%)4.02s (± 0.38%)~3.99s4.03sp=0.567 n=6
Bind Time1.88s (± 0.92%)1.88s (± 0.91%)~1.86s1.90sp=0.865 n=6
Check Time3.42s (± 1.08%)3.43s (± 0.82%)~3.40s3.47sp=0.872 n=6
Emit Time0.02s (±18.82%)0.02s (±21.89%)~0.02s0.03sp=0.282 n=6
Total Time9.37s (± 0.39%)9.38s (± 0.33%)~9.35s9.43sp=0.936 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-build-src-public-api - 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top 400 repos comparing main and refs/pull/58168/merge:

Everything looks good!

@weswighamweswigham merged commit a9b0d1e into microsoft:mainApr 12, 2024
@weswighamweswigham deleted the inference-instantiation-issue branch April 12, 2024 19:52
@microsoftmicrosoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Class infers wrong generic parameter since e1874f3

5 participants

@weswigham@typescript-bot@MichaelMitchell-at@jakebailey@RyanCavanaugh