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
TypeScript Version: 4.0.0-Beta
Search Terms:
Code
interface ITest { readonly name: string; } class Test implements ITest { #_name: string = ""; set name(value: string) { this.#_name = value; } } const test = new Test(); test.name = "James"; const it = test; console.log(it.name);
Expected behavior:
TSC can report a error since Test does not implment get name accessor.
Test
get name
ITest declare name property is readonly, that means name is readable. But name property of Test is not readable. It's against the interface.
ITest
name
Actual behavior:
No Error.
Playground Link: Provided
Related Issues:
maybe related to #12, but they are different.
The text was updated successfully, but these errors were encountered:
#21759 might be another way to think of this
Sorry, something went wrong.
TS doesn't have a notion of a "writeonly" property (see prior comment) so a property is always assumed to have a read side.
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
TypeScript Version: 4.0.0-Beta
Search Terms:
Code
Expected behavior:
TSC can report a error since
Test
does not implmentget name
accessor.ITest
declarename
property is readonly, that meansname
is readable. Butname
property ofTest
is not readable. It's against the interface.Actual behavior:
No Error.
Playground Link: Provided
Related Issues:
maybe related to #12, but they are different.
The text was updated successfully, but these errors were encountered: