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

Wrong extend relations for interface and Record #54514

Closed
Arcrsr opened this issue Jun 4, 2023 · 3 comments
Closed

Wrong extend relations for interface and Record #54514

Arcrsr opened this issue Jun 4, 2023 · 3 comments

Comments

@Arcrsr
Copy link

Arcrsr commented Jun 4, 2023

Bug Report

πŸ”Ž Search Terms

interface type Record condition

πŸ•— Version & Regression Information

  • 3.3.3 is the last version with the correct type

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

interface A {
  s: string;
}
type B = {
  s: string;
};
type R1 = A extends Record<string, any> ? true : false;
type R2 = B extends Record<string, any> ? true : false;
type R3 = A extends Record<string, unknown> ? true : false;
type R4 = B extends Record<string, unknown> ? true : false;

πŸ™ Actual behavior

R1, R2, R4 is true, and R3 is false

πŸ™‚ Expected behavior

R1, R2, R3, R4 is true

@MartinJohns
Copy link
Contributor

This is working as intended. interface and type are not fully interchangeable.

Duplicate of #42825. See also #15300 (comment).

@Arcrsr
Copy link
Author

Arcrsr commented Jun 4, 2023

Thank you for your help! It's my wrong understanding. I will close this bug issue.

@Arcrsr
Copy link
Author

Arcrsr commented Jun 4, 2023

Solved

@Arcrsr Arcrsr closed this as completed Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants