Hello all,

Sorry, I submitted a issue  on the tc39/proposals/issues/146. It seems to be a 
mistake.

This proposal adds static type constraints features to ECMAScript, based on the 
existing syntax, just use the features of void.

It is located in the variable initial value or declares the parameter default 
value or the first statement of the body of the function.




Example:  not all




```js

function CustomName(x = void ['', Number, mod.BigNumber]) {

  // Declarative results type, and the default value is not available

  void String;

  // same as void [String]

  // This function must eventually return a string

  // ...

}




class CustomClass {

  // ...

}




class PureStructure {

  constructor() {

    void {

      name: void [!'',String], // must be a name

      age: void [!0, Number], // must be age

      email: void String

    };

  }

}




class ClassPrototype {

  constructor() {

    void {

      name: String,

      age: Number,

      email: String

    };

  }

}




class FunctionPrototype {

  constructor() {

    void [[

      String,

      Number,

      String

    ]];

  }



}

```




Very embarrassing, my English is not awesome, so.........




See https://github.com/achun/proposal-static-type-constraints-features
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to