You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classApple{privatesize: number;constructor(size: number){this.size=size;}getSize(): number{returnthis.size;}}leta: Apple=newApple(4);console.log(a.Size);a.Size=5;// should this should throw a compile time error?
It strikes me that the attempted assignment to a.Size should produce a compile time error.
Instead we learn about it at runtime (target es6 with v1.6.0-dev.20150806)
[Error: Cannot set property Size of #<Apple> which has only a getter]
Thoughts?
The text was updated successfully, but these errors were encountered:
myitcv
changed the title
Missing getter/setter does not generate compile error
Accessing missing getter/setter does not generate compile error
Aug 8, 2015
Consider:
It strikes me that the attempted assignment to
a.Size
should produce a compile time error.Instead we learn about it at runtime (target
es6
withv1.6.0-dev.20150806
)Thoughts?
The text was updated successfully, but these errors were encountered: