-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Compile time comparison of accessors fails to differentiate on setter/getter #49046
Comments
This isnβt specific to accessors and happens with |
The other issue is the absence of a const x = { set foo(_x: string) {} }
x.foo = 'ok' // should be allowed
x.foo.includes('yikes') // should not be allowed |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Other
correctly causes a compile error as it does not haveprop
property.Immutable
passes compiler check even though theprop
property is read-only (just aget
)π Expected behavior
I would expect both
Other
andImmutable
to fail the typing oftest
as neither adhere to the structure ofMutable
.If inside
test
I try and setv.prop
whenImmutable
is passed in I get a runtime error. I would expect the typing to guard against this.The text was updated successfully, but these errors were encountered: