mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 14:31:28 +00:00
Implement optional trailing commas (#97)
This commit is contained in:
committed by
Daniel Wirtz
parent
25a1f6230a
commit
00fee73022
33
tests/parser/trailing-commas.ts
Normal file
33
tests/parser/trailing-commas.ts
Normal file
@ -0,0 +1,33 @@
|
||||
enum Foo {
|
||||
A,
|
||||
B,
|
||||
}
|
||||
|
||||
function add(
|
||||
x: i32,
|
||||
y: i32,
|
||||
): i32 {
|
||||
return x + y;
|
||||
}
|
||||
|
||||
function parameterized<
|
||||
A,
|
||||
B,
|
||||
>(a: A, b: B): void {
|
||||
}
|
||||
|
||||
export function compute(): i32 {
|
||||
const arr: Array<i8> = [
|
||||
1,
|
||||
2,
|
||||
];
|
||||
parameterized<
|
||||
i8,
|
||||
// @ts-ignore: Waiting on https://github.com/Microsoft/TypeScript/issues/21984
|
||||
i32,
|
||||
>(0, 0);
|
||||
return add(
|
||||
1,
|
||||
2,
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user