喻恒春 (2018-06-03T07:53:34.000Z)
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180603/4cc3caa6/attachment.html>
achun.shx at qq.com (2018-06-03T09:59:47.616Z)
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.


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

Example:  not all, See [proposal](https://github.com/achun/proposal-static-type-constraints-features)


```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: !String, // must be a name
      age: !Number,  // must be age
      email: String  // default undefined
    };
  }
}

class ClassPrototype {
  constructor() {
    void {
      name: String,
      age: Number,
      email: String
    };
  }
}

class FunctionPrototype {
  constructor() {
    void [[
      String,
      Number,
      String
    ]];
  }
}

```


-- YU HengChun
achun.shx at qq.com (2018-06-03T09:11:54.639Z)
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.


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

Example:  not all, See [proposal](https://github.com/achun/proposal-static-type-constraints-features)


```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: !String, // must be a name
      age: !Number,  // must be age
      email: String  // default undefined
    };
  }
}

class ClassPrototype {
  constructor() {
    void {
      name: String,
      age: Number,
      email: String
    };
  }
}

class FunctionPrototype {
  constructor() {
    void [[
      String,
      Number,
      String
    ]];
  }
}

```

achun.shx at qq.com (2018-06-03T08:19:43.740Z)
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.


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

Example:  not all, See [proposal](https://github.com/achun/proposal-static-type-constraints-features)


```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
    ]];
  }
}

```