assemblyscript/tests/parser/arrow-functions.ts
Daniel Wirtz e8b0767143
Infer function expressions in matching contexts (#514)
* legalizes omitting types on function expressions within function type contexts
* legalizes omitting any number of arguments
2019-02-27 21:45:36 +01:00

12 lines
152 B
TypeScript

// array function
(x): i32 => x;
(x: i32) => x;
(x?) => x;
(x?, y?) => x;
(x?: i32) => x;
x => x;
// not an array function
(b ? x : y);
(b ? f : g)();