Stuart Cook 3d4b801bb9
Simplify the special-case printing of single-param arrow functions (#13204)
* Simplify the special-case printing of single-param arrow functions

* Update test fixtures with single-param arrow functions

* Add some explicit snapshot tests for known edge-cases
2021-04-26 10:26:45 -04:00

17 lines
511 B
JavaScript

declare function foo(x: mixed): boolean %checks(x !== null);
declare function my_filter<T, P: $Pred<1>>(v: Array<T>, cb: P): Array<$Refine<T, P, 1>>;
declare function f2(x: mixed): string %checks(Array.isArray(x));
function foo(x: mixed): %checks {
return typeof x === "string";
}
function is_string(x): boolean %checks {
return typeof x === "string";
}
var f = (x: mixed): %checks => typeof x === "string";
const foo2 = (x: mixed): boolean %checks => typeof x === "string";
(x): %checks => x !== null;