Support definite assignment assertion x!: i32 (#260)

This commit is contained in:
Andy Hanson
2018-10-27 09:29:59 -07:00
committed by Daniel Wirtz
parent e58582e9e9
commit 0bb5cb829e
9 changed files with 84 additions and 17 deletions

View File

@ -990,6 +990,9 @@ export class ASTBuilder {
this.serializeAccessModifiers(node);
this.visitIdentifierExpression(node.name);
var sb = this.sb;
if (node.flags & CommonFlags.DEFINITE_ASSIGNMENT) {
sb.push("!");
}
var type = node.type;
if (type) {
sb.push(": ");
@ -1376,6 +1379,9 @@ export class ASTBuilder {
this.visitIdentifierExpression(node.name);
var type = node.type;
var sb = this.sb;
if (node.flags & CommonFlags.DEFINITE_ASSIGNMENT) {
sb.push("!");
}
if (type) {
sb.push(": ");
this.visitTypeNode(type);