Files
test-repo/tests/format/flow/function-parentheses/test.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.0 KiB
JavaScript
Raw Normal View History

2017-04-08 16:52:38 +02:00
type Banana = {
eat: string => boolean,
};
type Hex = {n: 0x01};
2019-10-09 19:52:11 +08:00
type T1 = { method: (a) => void };
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
type T2 = { method(a): void };
2017-04-08 16:52:38 +02:00
declare class X { method(a): void }
declare function f(a): void;
var f: (a) => void;
2019-10-09 19:52:11 +08:00
interface F1 { m(string): number }
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
interface F2 { m: (string) => number }
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
function f1(o: { f: (string) => void }) {}
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
function f2(o: { f(string): void }) {}
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
type f3 = (...arg) => void;
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
type f4 = (/* comment */ arg) => void;
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
type f5 = (arg /* comment */) => void;
2017-04-08 16:52:38 +02:00
2019-10-09 19:52:11 +08:00
type f6 = (?arg) => void;
2019-10-09 19:52:11 +08:00
class Y {
constructor(
ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection =
defaultIDEConnectionFactory,
) {
}
}
interface F {
ideConnectionFactoryLongLongLong: (child_process$ChildProcess) => FlowIDEConnection
}
type ExtractType = <A>(B<C>) => D
2019-10-09 19:52:11 +08:00
type T3 = ?(() => A);
2019-10-09 19:52:11 +08:00
type T4 = ?(() => A) | B;
2019-10-09 19:52:11 +08:00
type T5 = ?() => A | B;
2019-10-09 19:52:11 +08:00
type T6 = (?() => A) | B;
// https://github.com/babel/babel/issues/7924
//type T = ??() => A;
2019-10-09 19:52:11 +08:00
type T7 = ?(?(() => A));
2019-10-09 19:52:11 +08:00
type T8 = ?(?() => A) | B;