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

Comments

Projects
None yet
2 participants
@mwisnicki
Copy link

mwisnicki commented Aug 2, 2014

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

This comment has been minimized.

Copy link
Member

RyanCavanaugh commented Aug 4, 2014

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.