We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
property type inheritance
Playground link with relevant code
class A { p: true | 'string value' = true; o: {test: number} = {test: 1}; } class B extends A { p = 'string value'; o = {test: 5}; }
Error when overriding the p property:
p
Property 'p' in type 'B' is not assignable to the same property in base type 'A'. Type 'string' is not assignable to type 'true | "string value"'.
No errors, since the code is correct and types are respected
The text was updated successfully, but these errors were encountered:
Duplicate of #10570.
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
property type inheritance
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Error when overriding the
p
property:π Expected behavior
No errors, since the code is correct and types are respected
The text was updated successfully, but these errors were encountered: