Read-only properties and compilation issue

Topics: General
Jul 3, 2013 at 7:07 PM
Edited Jul 3, 2013 at 7:28 PM
Hi everyone !
Any idea why this code compiles with no error in TypeScript ?
class foo {
    get bar():string {
        return 'hello';
    }
}

var test = new foo();

// Should complain here since there's no "set"
test.bar = 'world';

alert('bar = ' + test.bar);
(the assignment is ignored at execution time though.)

Is it a bug, something you're working on, or did on purpose ?
Or did I miss something ?
Thanks for you help !
Jul 3, 2013 at 7:25 PM
Edited Jul 3, 2013 at 7:31 PM
oh, i found similar discussions here
https://typescript.codeplex.com/workitem/488
https://typescript.codeplex.com/discussions/398355
sorry for the duplicate.