Skip to content

Commit 7870e3a

Browse files
committed
Generic function type aliases
1 parent 423533c commit 7870e3a

14 files changed

+380
-470
lines changed

dist/asc.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ast.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ export abstract class Node {
902902

903903
static createTypeDeclaration(
904904
name: IdentifierExpression,
905+
typeParameters: TypeParameterNode[] | null,
905906
alias: CommonTypeNode,
906907
modifiers: ModifierNode[] | null,
907908
decorators: DecoratorNode[] | null,
@@ -910,7 +911,8 @@ export abstract class Node {
910911
var stmt = new TypeDeclaration();
911912
stmt.range = range;
912913
stmt.name = name; name.parent = stmt;
913-
stmt.alias = alias; alias.parent = stmt;
914+
stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);
915+
stmt.type = alias; alias.parent = stmt;
914916
stmt.modifiers = modifiers; if (modifiers) setParent(modifiers, stmt);
915917
stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);
916918
return stmt;
@@ -1728,8 +1730,10 @@ export class TryStatement extends Statement {
17281730
export class TypeDeclaration extends DeclarationStatement {
17291731
kind = NodeKind.TYPEDECLARATION;
17301732

1733+
/** Type parameters, if any. */
1734+
typeParameters: TypeParameterNode[] | null;
17311735
/** Type being aliased. */
1732-
alias: CommonTypeNode;
1736+
type: CommonTypeNode;
17331737
}
17341738

17351739
/** Represents a variable declaration part of a {@link VariableStatement}. */

0 commit comments

Comments
 (0)