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

Deleting readonly class members does not give type error #11730

Closed
pablobirukov opened this issue Oct 19, 2016 · 2 comments
Closed

Deleting readonly class members does not give type error #11730

pablobirukov opened this issue Oct 19, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@pablobirukov
Copy link

As @mhegazy said in #6717 deleting of readonly properties should follow the same rules as writing.

TypeScript Version: 2.0.3

Code

class Foo {
    public readonly bar: Bar;
    constructor() {
        this.bar = createBar(...);
    }
    public destroy() {
        delete this.bar; // here
    }
}

Expected behavior:
tsc should give a compile-time error
Actual behavior:
No error

@pablobirukov
Copy link
Author

Associated with #11480

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 19, 2016
@RyanCavanaugh
Copy link
Member

Any change we do in #11480 would apply equally here, so we can track the change at that issue. Thanks!

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants