Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend isEmptyAnonymousObjectType with support for non-generic mapped types #56974

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jan 7, 2024

fixes #56691

This makes non-generic mapped types with never constraints behave like {} (since it displays as {}). "If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck."

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jan 7, 2024
@@ -20849,7 +20849,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

function isEmptyAnonymousObjectType(type: Type) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this is different from isEmptyObjectType and none of those reuse the other. Perhaps with this change, some sharing could be introduced. I tried that at first and a lot of tests failed - but I didn't bother digging into this right now.

I don't really know what's the intended use case of both. Some code comments here would be highly appreciated. I could add the. However, I'd need first to learn from the team about the different goals of those two.

import { B, C, D } from './types2';

export class C implements Base {
a: Readonly<A> & { kind: 'a'; };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a somewhat unfortunate change. However, it matches the behavior of plain A that is {}. In such a case, A doesn't appear in the output after the refactoring. Maybe that's an issue worth raising? The intention of the user could have been to reuse types from the interface quite literally - so when they start implementing A's members the C class automatically "receives" them.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that it might be unfortunate, but I think this change is ok. If we want to have a mechanism for preserving those kinds of intersections in refactorings and codefixes, we need it to also work for A & { kind: ... }.

Comment on lines +18 to +20
verify.completions({ marker: "3", exact: [] });
verify.completions({ marker: "4", exact: [] });
verify.completions({ marker: "5", includes: ["a", "b", "c"] });
verify.completions({ marker: "5", exact: [] });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Record<never, never> is just {} with this PR those are expected here. Those unions were reduced to just string and thus concrete literal strings can no longer be suggested.

Both of those changed locations obey the rule from #49119 :

For backwards compatibility, special exceptions to the T & {} type reduction rules existing for intersections written explicitly as string & {}, number & {}, and bigint & {} (as opposed to created through instantiation of a generic type T & {}).

Copy link
Member

Choose a reason for hiding this comment

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

How is it that this string & Record<never, never> was being preserved before? Is it because, before this PR, Record<never, never> was some mapped type and we couldn't do subtype reduction on the intersection?

I'm curious to see if this breaks people, since this is in our tests, but you're right, officially we only support string & {} explicitly written as so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it because, before this PR, Record<never, never> was some mapped type and we couldn't do subtype reduction on the intersection?

IIRC - yeah, something like that. The type was not reduced to {} so it stayed as a mapped type and that wasn't reduced. But with this change it's treated like {} so intersections containing it are way more easily reducible.

@sandersn sandersn added this to Not started in PR Backlog Jan 23, 2024
@sandersn sandersn moved this from Not started to Waiting on reviewers in PR Backlog Jan 30, 2024
@gabritto
Copy link
Member

@typescript-bot run DT
@typescript-bot user test this
@typescript-bot test top200
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 30, 2024

Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at 081619e. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 30, 2024

Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at 081619e. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 30, 2024

Heya @gabritto, I've started to run the diff-based user code test suite on this PR at 081619e. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 30, 2024

Heya @gabritto, I've started to run the regular perf test suite on this PR at 081619e. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/56974/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

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot
Copy link
Collaborator

@gabritto
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,644k (± 0.01%) 295,661k (± 0.01%) ~ 295,628k 295,708k p=0.378 n=6
Parse Time 2.66s (± 0.31%) 2.66s (± 0.19%) ~ 2.65s 2.66s p=0.929 n=6
Bind Time 0.83s (± 1.40%) 0.83s (± 0.99%) ~ 0.82s 0.84s p=0.498 n=6
Check Time 8.20s (± 0.31%) 8.20s (± 0.49%) ~ 8.15s 8.26s p=0.687 n=6
Emit Time 7.09s (± 0.30%) 7.09s (± 0.29%) ~ 7.06s 7.11s p=0.623 n=6
Total Time 18.78s (± 0.24%) 18.78s (± 0.25%) ~ 18.72s 18.83s p=1.000 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 194,425k (± 1.63%) 192,507k (± 1.24%) ~ 191,485k 197,376k p=0.298 n=6
Parse Time 1.36s (± 0.60%) 1.36s (± 1.42%) ~ 1.34s 1.39s p=0.933 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.36s (± 0.26%) 9.34s (± 0.28%) ~ 9.31s 9.38s p=0.225 n=6
Emit Time 2.63s (± 0.74%) 2.62s (± 0.98%) ~ 2.58s 2.64s p=0.418 n=6
Total Time 14.07s (± 0.31%) 14.04s (± 0.37%) ~ 13.95s 14.09s p=0.297 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,460k (± 0.01%) 347,475k (± 0.01%) ~ 347,444k 347,495k p=0.172 n=6
Parse Time 2.48s (± 0.61%) 2.48s (± 0.78%) ~ 2.45s 2.50s p=0.682 n=6
Bind Time 0.92s (± 0.59%) 0.93s (± 0.56%) ~ 0.92s 0.93s p=0.640 n=6
Check Time 6.94s (± 0.53%) 6.95s (± 0.35%) ~ 6.92s 6.98s p=0.872 n=6
Emit Time 4.06s (± 0.33%) 4.06s (± 0.53%) ~ 4.03s 4.09s p=0.935 n=6
Total Time 14.40s (± 0.15%) 14.41s (± 0.16%) ~ 14.39s 14.45s p=0.570 n=6
TFS - node (v18.15.0, x64)
Memory used 302,834k (± 0.00%) 302,836k (± 0.00%) ~ 302,822k 302,854k p=1.000 n=6
Parse Time 2.01s (± 0.80%) 2.00s (± 1.51%) ~ 1.95s 2.03s p=0.565 n=6
Bind Time 1.00s (± 0.75%) 1.01s (± 0.97%) ~ 1.00s 1.02s p=0.300 n=6
Check Time 6.32s (± 0.10%) 6.32s (± 0.40%) ~ 6.28s 6.34s p=0.507 n=6
Emit Time 3.59s (± 0.37%) 3.60s (± 0.25%) ~ 3.59s 3.61s p=0.156 n=6
Total Time 12.92s (± 0.11%) 12.92s (± 0.34%) ~ 12.85s 12.98s p=0.745 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,312k (± 0.00%) 511,110k (± 0.01%) -202k (- 0.04%) 511,083k 511,157k p=0.005 n=6
Parse Time 2.65s (± 0.70%) 2.64s (± 0.82%) ~ 2.62s 2.68s p=0.330 n=6
Bind Time 0.99s (± 0.99%) 1.00s (± 0.75%) ~ 0.99s 1.01s p=0.300 n=6
Check Time 17.25s (± 0.51%) 17.23s (± 0.52%) ~ 17.06s 17.31s p=1.000 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.90s (± 0.44%) 20.88s (± 0.39%) ~ 20.73s 20.96s p=1.000 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,695,119k (± 0.00%) 1,695,134k (± 0.00%) ~ 1,695,050k 1,695,179k p=0.229 n=6
Parse Time 6.51s (± 0.37%) 6.54s (± 0.42%) ~ 6.51s 6.58s p=0.225 n=6
Bind Time 2.37s (± 0.46%) 2.37s (± 0.35%) ~ 2.35s 2.37s p=0.652 n=6
Check Time 55.31s (± 0.33%) 55.36s (± 0.39%) ~ 55.00s 55.57s p=0.688 n=6
Emit Time 0.16s (± 2.52%) 0.16s (± 0.00%) ~ 0.16s 0.16s p=0.405 n=6
Total Time 64.35s (± 0.30%) 64.42s (± 0.35%) ~ 64.04s 64.61s p=0.630 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,410,416k (± 0.01%) 2,410,258k (± 0.02%) ~ 2,409,649k 2,410,800k p=0.689 n=6
Parse Time 4.89s (± 0.82%) 4.92s (± 0.80%) ~ 4.85s 4.96s p=0.170 n=6
Bind Time 1.88s (± 0.52%) 1.89s (± 0.73%) ~ 1.87s 1.90s p=0.677 n=6
Check Time 33.41s (± 0.34%) 33.41s (± 0.42%) ~ 33.20s 33.58s p=1.000 n=6
Emit Time 2.72s (± 1.37%) 2.70s (± 0.54%) ~ 2.68s 2.71s p=0.280 n=6
Total Time 42.90s (± 0.21%) 42.94s (± 0.27%) ~ 42.80s 43.08s p=0.689 n=6
self-compiler - node (v18.15.0, x64)
Memory used 418,601k (± 0.01%) 418,669k (± 0.01%) +68k (+ 0.02%) 418,607k 418,720k p=0.031 n=6
Parse Time 2.80s (± 2.07%) 2.82s (± 0.79%) ~ 2.79s 2.84s p=0.570 n=6
Bind Time 1.09s (± 5.25%) 1.07s (± 0.38%) ~ 1.07s 1.08s p=0.924 n=6
Check Time 15.02s (± 0.28%) 15.06s (± 0.50%) ~ 14.96s 15.17s p=0.228 n=6
Emit Time 1.14s (± 1.33%) 1.14s (± 1.17%) ~ 1.12s 1.15s p=0.682 n=6
Total Time 20.06s (± 0.19%) 20.10s (± 0.47%) ~ 19.99s 20.23s p=0.627 n=6
vscode - node (v18.15.0, x64)
Memory used 2,810,838k (± 0.00%) 2,810,824k (± 0.00%) ~ 2,810,788k 2,810,855k p=0.689 n=6
Parse Time 10.62s (± 0.13%) 10.62s (± 0.32%) ~ 10.58s 10.68s p=1.000 n=6
Bind Time 3.40s (± 0.22%) 3.40s (± 0.15%) ~ 3.39s 3.40s p=0.241 n=6
Check Time 59.99s (± 0.53%) 59.94s (± 0.51%) ~ 59.56s 60.44s p=0.810 n=6
Emit Time 16.07s (± 0.35%) 16.15s (± 1.09%) ~ 15.98s 16.47s p=0.378 n=6
Total Time 90.08s (± 0.34%) 90.12s (± 0.38%) ~ 89.55s 90.59s p=0.936 n=6
webpack - node (v18.15.0, x64)
Memory used 393,447k (± 0.01%) 393,466k (± 0.01%) ~ 393,364k 393,524k p=0.521 n=6
Parse Time 3.08s (± 0.69%) 3.08s (± 0.69%) ~ 3.05s 3.11s p=0.935 n=6
Bind Time 1.39s (± 1.36%) 1.38s (± 1.00%) ~ 1.36s 1.40s p=0.156 n=6
Check Time 13.96s (± 0.36%) 13.99s (± 0.30%) ~ 13.95s 14.07s p=0.335 n=6
Emit Time 0.00s (± 0.00%) 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 18.43s (± 0.28%) 18.44s (± 0.27%) ~ 18.40s 18.53s p=0.936 n=6
xstate - node (v18.15.0, x64)
Memory used 513,395k (± 0.02%) 513,399k (± 0.01%) ~ 513,351k 513,469k p=0.378 n=6
Parse Time 3.28s (± 0.25%) 3.27s (± 0.16%) ~ 3.27s 3.28s p=0.523 n=6
Bind Time 1.54s (± 0.49%) 1.54s (± 0.53%) ~ 1.54s 1.56s p=1.000 n=6
Check Time 2.86s (± 1.05%) 2.85s (± 0.68%) ~ 2.83s 2.88s p=0.567 n=6
Emit Time 0.08s (± 4.99%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=1.000 n=6
Total Time 7.76s (± 0.27%) 7.76s (± 0.41%) ~ 7.73s 7.81s p=0.421 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,350ms (± 0.78%) 2,344ms (± 0.78%) ~ 2,328ms 2,373ms p=0.521 n=6
Req 2 - geterr 5,512ms (± 1.82%) 5,518ms (± 1.86%) ~ 5,404ms 5,644ms p=0.936 n=6
Req 3 - references 323ms (± 1.25%) 325ms (± 1.34%) ~ 321ms 331ms p=0.418 n=6
Req 4 - navto 278ms (± 1.18%) 275ms (± 1.40%) ~ 271ms 279ms p=0.282 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 88ms (± 5.59%) 88ms (± 6.92%) ~ 80ms 95ms p=1.000 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,479ms (± 0.60%) 2,476ms (± 1.09%) ~ 2,438ms 2,500ms p=0.936 n=6
Req 2 - geterr 4,164ms (± 2.01%) 4,170ms (± 1.73%) ~ 4,114ms 4,270ms p=0.471 n=6
Req 3 - references 337ms (± 1.77%) 340ms (± 1.35%) ~ 331ms 343ms p=0.254 n=6
Req 4 - navto 285ms (± 1.05%) 285ms (± 0.72%) ~ 283ms 289ms p=0.737 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 84ms (± 8.51%) 87ms (± 5.76%) ~ 77ms 90ms p=0.868 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,607ms (± 0.36%) 2,605ms (± 0.74%) ~ 2,575ms 2,633ms p=1.000 n=6
Req 2 - geterr 1,723ms (± 2.75%) 1,703ms (± 2.38%) ~ 1,659ms 1,767ms p=0.470 n=6
Req 3 - references 117ms (± 9.85%) 123ms (± 6.44%) ~ 107ms 128ms p=0.808 n=6
Req 4 - navto 369ms (± 0.57%) 375ms (± 2.70%) ~ 369ms 395ms p=0.162 n=6
Req 5 - completionInfo count 2,078 (± 0.00%) 2,078 (± 0.00%) ~ 2,078 2,078 p=1.000 n=6
Req 5 - completionInfo 306ms (± 2.59%) 303ms (± 1.89%) ~ 294ms 310ms p=0.575 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)
  • xstateTSServer - 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 153.02ms (± 0.22%) 152.94ms (± 0.17%) ~ 151.81ms 157.54ms p=0.161 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 228.68ms (± 0.14%) 228.41ms (± 0.14%) -0.28ms (- 0.12%) 227.31ms 231.40ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 231.29ms (± 0.20%) 231.22ms (± 0.17%) ~ 229.32ms 235.68ms p=0.196 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 230.29ms (± 0.17%) 230.35ms (± 0.17%) ~ 228.79ms 233.94ms p=0.136 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

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: react-aria-live
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-aria-live/react-aria-live-tests.tsx
   5:2  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): LiveAnnouncer', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LiveAnnouncer>'.
  Overload 2 of 2, '(props: {}, context: any): LiveAnnouncer', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LiveAnnouncer>'  @definitelytyped/expect
  13:2  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): LiveAnnouncer', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LiveAnnouncer>'.
  Overload 2 of 2, '(props: {}, context: any): LiveAnnouncer', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LiveAnnouncer>'  @definitelytyped/expect

✖ 2 problems (2 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-instantsearch-native
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-instantsearch-native/react-instantsearch-native-tests.tsx
  12:10  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect
  15:22  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect
  23:22  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect
  31:22  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect

✖ 4 problems (4 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: reactable
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/reactable/reactable-tests.tsx
  71:18  error  TypeScript@local compile error: 
Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Thead>'  @definitelytyped/expect
  75:18  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Tfoot>'    @definitelytyped/expect

✖ 2 problems (2 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: relay-test-utils
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/relay-test-utils/test/classical.tsx
  22:17  error  TypeScript@local compile error: 
Argument of type 'Container<Omit<unknown, "relay">>' is not assignable to parameter of type 'ComponentType<RelayProp | RelayPaginationProp | RelayRefetchProp | { componentRef?: ((ref: any) => void) | undefined; }>'.
  Type 'ComponentClass<{ componentRef?: ((ref: any) => void) | undefined; }, any>' is not assignable to type 'ComponentType<RelayProp | RelayPaginationProp | RelayRefetchProp | { componentRef?: ((ref: any) => void) | undefined; }>'.
    Type 'ComponentClass<{ componentRef?: ((ref: any) => void) | undefined; }, any>' is not assignable to type 'ComponentClass<RelayProp | RelayPaginationProp | RelayRefetchProp | { componentRef?: ((ref: any) => void) | undefined; }, any>'.
      Types of property 'getDerivedStateFromProps' are incompatible.
        Type 'GetDerivedStateFromProps<{ componentRef?: ((ref: any) => void) | undefined; }, any> | undefined' is not assignable to type 'GetDerivedStateFromProps<RelayProp | RelayPaginationProp | RelayRefetchProp | { componentRef?: ((ref: any) => void) | undefined; }, any> | undefined'.
          Type 'GetDerivedStateFromProps<{ componentRef?: ((ref: any) => void) | undefined; }, any>' is not assignable to type 'GetDerivedStateFromProps<RelayProp | RelayPaginationProp | RelayRefetchProp | { componentRef?: ((ref: any) => void) | undefined; }, any>'.
            Types of parameters 'nextProps' and 'nextProps' are incompatible.
              Type 'Readonly<RelayProp | RelayPaginationProp | RelayRefetchProp | { componentRef?: ((ref: any) => void) | undefined; }>' is not assignable to type 'Readonly<{ componentRef?: ((ref: any) => void) | undefined; }>'.
                Type 'Readonly<RelayProp>' has no properties in common with type 'Readonly<{ componentRef?: ((ref: any) => void) | undefined; }>'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-native-modals
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-native-modals/react-native-modals-tests.tsx
  117:14  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): ModalPortal', gave the following error.
    Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<ModalPortal>'.
  Overload 2 of 2, '(props: {}, context: any): ModalPortal', gave the following error.
    Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<ModalPortal>'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: solid__react
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/solid__react/solid__react-tests.tsx
  32:14  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): LoggedIn', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LoggedIn>'.
  Overload 2 of 2, '(props: {}, context: any): LoggedIn', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LoggedIn>'      @definitelytyped/expect
  33:14  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): LoggedOut', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LoggedOut>'.
  Overload 2 of 2, '(props: {}, context: any): LoggedOut', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<LoggedOut>'  @definitelytyped/expect

✖ 2 problems (2 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-gateway
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-gateway/react-gateway-tests.tsx
  25:14  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): GatewayProvider', gave the following error.
    Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<GatewayProvider>'.
  Overload 2 of 2, '(props: {}, context: any): GatewayProvider', gave the following error.
    Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<GatewayProvider>'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-helmet-with-visor
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-helmet-with-visor/react-helmet-with-visor-tests.tsx
   10:14  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): HelmetsOpenedVisor', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HelmetsOpenedVisor>'.
  Overload 2 of 2, '(props: {}, context: any): HelmetsOpenedVisor', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HelmetsOpenedVisor>'  @definitelytyped/expect
  131:6   error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): HelmetsOpenedVisor', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HelmetsOpenedVisor>'.
  Overload 2 of 2, '(props: {}, context: any): HelmetsOpenedVisor', gave the following error.
    Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HelmetsOpenedVisor>'  @definitelytyped/expect

✖ 2 problems (2 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-instantsearch-core
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-instantsearch-core/react-instantsearch-core-tests.tsx
  113:6  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: dom-css
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/dom-css/dom-css-tests.ts
  33:1  error  TypeScript@local expected type to be:
  { left: string; marginTop: string; }
got:
  { [x: string]: string; }  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-instantsearch
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-instantsearch/react-instantsearch-tests.tsx
  275:14  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect
  278:26  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect
  286:26  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect
  294:26  error  TypeScript@local compile error: 
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, any, any>>'  @definitelytyped/expect

✖ 4 problems (4 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: react-switch-case
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/react-switch-case/react-switch-case-tests.tsx
  16:18  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): Default', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Default>'.
  Overload 2 of 2, '(props: {}, context: any): Default', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Default>'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

Package: jest
Error:

Error: 
/home/vsts/work/1/DefinitelyTyped/types/jest/jest-tests.ts
  769:1  error  TypeScript@local expected type to be:
  MockedObjectDeep<{}>
got:
  {}  @definitelytyped/expect
  771:1  error  TypeScript@local expected type to be:
  MockedObjectDeep<{}>
got:
  {}  @definitelytyped/expect
  773:1  error  TypeScript@local expected type to be:
  MockedObject<{}>
got:
  {}      @definitelytyped/expect

✖ 3 problems (3 errors, 0 warnings)

    at testTypesVersion (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:166:15)
    at async runTests (/home/vsts/work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.4_typescript@5.4.0-dev.20240130/node_modules/@definitelytyped/dtslint/dist/index.js:125:9)

You can check the log here.

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/56974/merge:

Something interesting changed - please have a look.

Details

apollographql/apollo-client

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

src/tsconfig.json

AykutSarac/jsoncrack.com

tsconfig.json

date-fns/date-fns

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

tsconfig.json

nextauthjs/next-auth

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

packages/adapter-drizzle/tsconfig.json

recharts/recharts

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

demo/tsconfig.json

tsconfig.json

slidevjs/slidev

packages/slidev/tsconfig.json

tsconfig.json

TanStack/query

52 of 60 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2322: Type '"svelte"' is not assignable to type 'LiteralUnion<BuiltInParserName, string> | undefined'.

@gabritto
Copy link
Member

Seems like there are many breaks on the top repos test :/

Copy link
Member

@gabritto gabritto left a comment

Choose a reason for hiding this comment

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

PR Backlog automation moved this from Waiting on reviewers to Waiting on author Apr 30, 2024
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: Waiting on author
PR Backlog
  
Waiting on author
Development

Successfully merging this pull request may close these issues.

Empty types and types with never as a key behave differently
4 participants