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

Compiler allows assignments to read-only properties #339

Closed
mwisnicki opened this issue Aug 2, 2014 · 1 comment
Closed

Compiler allows assignments to read-only properties #339

mwisnicki opened this issue Aug 2, 2014 · 1 comment
Labels
Duplicate An existing issue was already created Suggestion An idea for TypeScript

Comments

@mwisnicki
Copy link

http://typescript.codeplex.com/workitem/488

"use strict";
class SomeClass {
    public get someProperty(): string {
        return "some value";
    }
}
var someInstance = new SomeClass();
someInstance.someProperty = "another value"; //Run-time error. ECMAScript 5.1 - 11.13.1
@RyanCavanaugh
Copy link
Member

Duplicate of #12

Defining a get-only accessor does not create a read-only property because TypeScript does not have a notion of read-only properties

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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 Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants