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

Remove normalization of TS2741 as TS2322 #768

Open
kdy1 opened this issue Feb 28, 2023 Discussed in #767 · 2 comments
Open

Remove normalization of TS2741 as TS2322 #768

kdy1 opened this issue Feb 28, 2023 Discussed in #767 · 2 comments

Comments

@kdy1
Copy link
Member

kdy1 commented Feb 28, 2023

This is for 1.0, not alpha nor 0.1

Discussed in #767

Originally posted by kdy1 February 28, 2023
I decided to normalize TS2741 as TS2322 for alpha because of the following case.

https://www.typescriptlang.org/play?#code/MYGwhgzhAEDC0G9oF8BQpIwCLQKYA8AXXAOwBMZ4kAzAe1oEYAKASkRRXXCmgFE8ipCnHZ1aAJlbtknVGVwYATrmgA3MIuhkAXNCwBuOQvDK1GvLt6HUAehvQAgtACuJAJa0S0QgE8ADioAqtBuMJhuAOYkYABGICqEtNBg3v4qACoh1HhgwAAWqQEhXsGhyVCR0XEJSely0AC8eIYqTWTWZI3NqK1ahkA

class C { }
class D extends C { foo1() { } }
class E extends C { foo2() { } }

declare var d: D;
declare var e: E;

// A union type U is assignable to a type T if each type in U is assignable to T
d = e;
e = d;

d = e;
e = d;

Error

Property 'foo1' is missing in type 'E' but required in type 'D'.
Property 'foo2' is missing in type 'D' but required in type 'E'.
Type 'E' is not assignable to type 'D'.
Type 'D' is not assignable to type 'E'.

So it means we should report TS2741 only for the first error.

@sunrabbit123
Copy link
Collaborator

Has this issue been resolved?

@kdy1
Copy link
Member Author

kdy1 commented Apr 11, 2023

No, but I found that tsc is emitting TS2741 only for the first error, so I think TS2741 vs TS2322 is meaningless for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants