Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Do not setvalueDeclaration for intersection properties when one symbol does not have avalueDeclaration#61872

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mdm317 wants to merge2 commits intomicrosoft:main
base:main
Choose a base branch
Loading
frommdm317:fix-61743-

Conversation

mdm317
Copy link

Fixes#61743
This issue arised because the intersection types are different.

declare class X {private a: number;b: string;}type Y = { a: number } & { b: string };type Z = Pick<{ a: number }, 'a'> & { b: string };type T1 = X & Y // T1 is nevertype T2 = X & Z // but T2 is not never

@typescript-bottypescript-bot added the For Backlog BugPRs that fix a backlog bug labelJun 15, 2025
@@ -15547,7 +15547,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
let firstValueDeclaration: Declaration | undefined;
let hasNonUniformValueDeclaration = false;
for (const prop of props) {
if (!firstValueDeclaration) {
if(!prop.valueDeclaration){
Copy link
Author

Choose a reason for hiding this comment

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

InisConflictingPrivateProperty, if symbols are not uniform and has private properties, determine property is conflict

    function isConflictingPrivateProperty(prop: Symbol) {        // Return true for a synthetic property with multiple declarations, at least one of which is private.        return !prop.valueDeclaration && !!(getCheckFlags(prop) & CheckFlags.ContainsPrivate);    }

Currently, a intersection/uniform property is treated as uniform when one source property has a valueDeclaration, while another source property(mapped type) does not.
I think we should treat such properties as non-uniform instead.

@mdm317
Copy link
Author

@microsoft-github-policy-service agree

@mdm317mdm317 marked this pull request as ready for reviewJune 15, 2025 16:20
@jakebailey
Copy link
Member

@typescript-bot test it

typescript-bot reacted with thumbs up emoji

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJun 30, 2025
edited
Loading

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

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

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparingmain andrefs/pull/61872/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
Compiler-Unions - node (v18.15.0, x64)
Errors3434~~~p=1.000 n=6
Symbols62,37062,370~~~p=1.000 n=6
Types50,38650,386~~~p=1.000 n=6
Memory used195,961k (± 0.76%)195,909k (± 0.73%)~193,004k196,672kp=0.575 n=6
Parse Time1.58s (± 1.68%)1.60s (± 1.52%)~1.56s1.63sp=0.366 n=6
Bind Time0.88s (± 1.24%)0.87s (± 1.34%)~0.85s0.88sp=0.170 n=6
Check Time11.76s (± 0.64%)11.78s (± 0.42%)~11.71s11.85sp=0.748 n=6
Emit Time3.34s (± 3.42%)3.34s (± 3.63%)~3.27s3.58sp=0.683 n=6
Total Time17.57s (± 0.96%)17.59s (± 0.68%)~17.48s17.82sp=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors5656~~~p=1.000 n=6
Symbols948,753948,753~~~p=1.000 n=6
Types410,846410,846~~~p=1.000 n=6
Memory used1,225,205k (± 0.00%)1,225,206k (± 0.00%)~1,225,173k1,225,238kp=0.630 n=6
Parse Time7.90s (± 0.73%)7.98s (± 0.51%)+0.07s (+ 0.93%)7.93s8.04sp=0.037 n=6
Bind Time2.29s (± 0.36%)2.28s (± 0.37%)~2.27s2.29sp=0.120 n=6
Check Time38.09s (± 0.42%)38.10s (± 0.25%)~38.03s38.28sp=0.808 n=6
Emit Time17.82s (± 0.49%)17.85s (± 0.54%)~17.74s17.98sp=0.748 n=6
Total Time66.11s (± 0.36%)66.20s (± 0.16%)~66.09s66.36sp=0.471 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,509,1832,509,183~~~p=1.000 n=6
Types892,716892,716~~~p=1.000 n=6
Memory used2,804,513k (± 0.00%)2,804,431k (± 0.00%)~2,804,343k2,804,572kp=0.093 n=6
Parse Time10.46s (± 0.24%)10.46s (± 0.16%)~10.43s10.47sp=0.935 n=6
Bind Time2.71s (± 1.01%)2.73s (± 0.55%)~2.70s2.74sp=0.622 n=6
Check Time100.98s (± 1.03%)101.23s (± 1.15%)~100.05s103.13sp=0.873 n=6
Emit Time0.36s (± 2.24%)0.37s (± 2.29%)~0.35s0.37sp=0.485 n=6
Total Time114.52s (± 0.91%)114.78s (± 1.01%)~113.58s116.66sp=0.688 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,227,0811,227,081~~~p=1.000 n=6
Types267,474267,474~~~p=1.000 n=6
Memory used2,853,238k (±13.21%)2,975,326k (±10.02%)~2,365,962k3,098,033kp=0.378 n=6
Parse Time8.25s (± 1.50%)8.27s (± 1.82%)~7.97s8.38sp=0.688 n=6
Bind Time2.68s (± 1.74%)2.65s (± 1.80%)~2.59s2.71sp=0.471 n=6
Check Time53.00s (± 0.54%)53.18s (± 0.17%)~53.07s53.31sp=0.575 n=6
Emit Time4.31s (± 2.19%)4.31s (± 1.95%)~4.23s4.44sp=0.630 n=6
Total Time68.26s (± 0.65%)68.41s (± 0.33%)~68.10s68.68sp=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,227,0811,227,081~~~p=1.000 n=6
Types267,474267,474~~~p=1.000 n=6
Memory used2,430,272k (± 0.02%)2,551,834k (±11.63%)~2,429,873k3,158,365kp=0.230 n=6
Parse Time5.40s (± 0.83%)5.38s (± 1.35%)~5.31s5.52sp=0.520 n=6
Bind Time1.83s (± 0.80%)1.83s (± 1.17%)~1.80s1.86sp=0.745 n=6
Check Time35.27s (± 0.34%)35.25s (± 0.78%)~35.05s35.80sp=0.230 n=6
Emit Time3.04s (± 1.52%)3.05s (± 1.05%)~3.00s3.09sp=0.686 n=6
Total Time45.54s (± 0.26%)45.51s (± 0.74%)~45.32s46.19sp=0.261 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols262,548262,548~~~p=1.000 n=6
Types107,156107,156~~~p=1.000 n=6
Memory used441,920k (± 0.03%)441,879k (± 0.01%)~441,822k441,921kp=1.000 n=6
Parse Time3.52s (± 0.80%)3.54s (± 0.97%)~3.51s3.59sp=0.368 n=6
Bind Time1.32s (± 1.04%)1.32s (± 0.62%)~1.31s1.33sp=0.932 n=6
Check Time18.85s (± 0.38%)18.93s (± 0.50%)~18.84s19.08sp=0.261 n=6
Emit Time1.54s (± 1.35%)1.52s (± 1.73%)~1.50s1.56sp=0.366 n=6
Total Time25.23s (± 0.39%)25.31s (± 0.48%)~25.18s25.51sp=0.377 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors7171~~~p=1.000 n=6
Symbols225,367225,367~~~p=1.000 n=6
Types94,29094,290~~~p=1.000 n=6
Memory used371,081k (± 0.01%)371,190k (± 0.04%)~371,056k371,381kp=0.173 n=6
Parse Time2.86s (± 1.75%)2.88s (± 0.92%)~2.86s2.92sp=0.871 n=6
Bind Time1.58s (± 0.48%)1.60s (± 1.21%)+0.02s (+ 1.26%)1.58s1.63sp=0.046 n=6
Check Time16.36s (± 0.25%)16.35s (± 0.17%)~16.32s16.40sp=0.809 n=6
Emit Time0.00s (±244.70%)0.00s~~~p=0.405 n=6
Total Time20.81s (± 0.27%)20.84s (± 0.12%)~20.80s20.87sp=0.376 n=6
vscode - node (v18.15.0, x64)
Errors3333~~~p=1.000 n=6
Symbols3,499,2973,499,297~~~p=1.000 n=6
Types1,177,2141,177,214~~~p=1.000 n=6
Memory used3,549,844k (± 0.01%)3,549,901k (± 0.00%)~3,549,714k3,550,073kp=0.471 n=6
Parse Time15.06s (± 0.73%)15.16s (± 0.60%)~15.04s15.27sp=0.093 n=6
Bind Time4.91s (± 0.62%)4.87s (± 0.30%)-0.04s (- 0.75%)4.85s4.89sp=0.007 n=6
Check Time96.45s (± 3.21%)95.93s (± 3.23%)~93.85s101.70sp=0.471 n=6
Emit Time31.07s (± 7.59%)31.07s (± 7.99%)~29.41s35.90sp=0.810 n=6
Total Time147.48s (± 3.50%)147.03s (± 2.46%)~143.59s152.71sp=0.936 n=6
webpack - node (v18.15.0, x64)
Errors22~~~p=1.000 n=6
Symbols318,019318,019~~~p=1.000 n=6
Types137,705137,705~~~p=1.000 n=6
Memory used472,117k (± 0.02%)472,204k (± 0.03%)~472,028k472,417kp=0.298 n=6
Parse Time4.32s (± 0.47%)4.36s (± 0.76%)~4.32s4.41sp=0.050 n=6
Bind Time1.76s (± 2.00%)1.76s (± 1.29%)~1.73s1.79sp=0.744 n=6
Check Time20.65s (± 0.50%)20.72s (± 0.26%)~20.64s20.77sp=0.227 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time26.73s (± 0.44%)26.83s (± 0.24%)~26.75s26.90sp=0.128 n=6
xstate-main - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols665,978665,978~~~p=1.000 n=6
Types199,345199,345~~~p=1.000 n=6
Memory used570,406k (± 0.01%)570,405k (± 0.01%)~570,284k570,540kp=0.689 n=6
Parse Time4.28s (± 0.38%)4.26s (± 0.47%)~4.24s4.29sp=0.157 n=6
Bind Time1.33s (± 0.57%)1.33s (± 1.46%)~1.31s1.36sp=0.742 n=6
Check Time19.91s (± 0.31%)19.86s (± 0.25%)~19.78s19.91sp=0.127 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time25.52s (± 0.27%)25.45s (± 0.28%)~25.35s25.54sp=0.128 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparingmain andrefs/pull/61872/merge:

Everything looks good!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
For Backlog BugPRs that fix a backlog bug
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Intersection with a mapped type breaks bypassing private assignability.
3 participants
@mdm317@jakebailey@typescript-bot

[8]ページ先頭

©2009-2025 Movatter.jp