Private static properties in TypeScript

typescript

Solution

It should be an error but isn't. From the spec, section 8.2.1:

It is not possible to specify the accessibility of statics—they are effectively always public.

Accessibility modifiers on statics are something the team has considered in the past. If you have a strong use case you should bring this up on codeplex site!

Problem

If I do something like this below, how can I access the property out the class? ``` class Person { private static name: string; } console.log(Person.name); ``` Shouldn't it inaccessible?

Original source