sirisian / ecmascript-types

ECMAScript Optional Static Typing Proposal http://sirisian.github.io/ecmascript-types/
453 stars 4 forks source link

Create examples with private and static typed class members #58

Closed sirisian closed 2 years ago

sirisian commented 3 years ago

See these proposals:

https://github.com/tc39/proposal-private-methods
https://github.com/tc39/proposal-static-class-features

I already have public fields in the document, and there's no conflicting syntax.

class A {
  a:uint8 = 0
  #b:uint8 = 0
  static #c:uint8 = 0
  get #d():uint8 { return #b; }
  set #d(value) {
    #b = value;
  }
  static #e(a:A, value:uint8) {
    a.#b = value;
  }
}
sirisian commented 2 years ago

Already included. There's no conflicts.