mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-25 12:41:50 +00:00
Support definite assignment assertion x!: i32
(#260)
This commit is contained in:
committed by
Daniel Wirtz
parent
e58582e9e9
commit
0bb5cb829e
@ -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);
|
||||
|
Reference in New Issue
Block a user