Files
test-repo/tests/flow/call_properties/D.js
T
Christopher Chedeau 3375cfe605 Move tests around (#454)
* new_tests

* move_all_clobbered_tests

* remove all the tests that no longer exist

* re-run flow tests

* Move all the flow tests to tests/flow and prettier to tests/

* Move prettier tests to their own folders

* Add jsfmt files

* run prettier snapshot tests
2017-01-24 14:35:37 -08:00

23 lines
701 B
JavaScript

// Multiple call properties should also be supported
function a(f: { (): string; (x: number): string }): string {
return f() + f(123);
}
// It should be fine when a function satisfies them all
var b: { (): string; (x: number): string } =
function (x?: number): string { return "hi"; };
// ...but should notice when a function doesn't satisfy them all
var c: { (): string; (x: number): string } =
function (x: number): string { return "hi"; };
// Only one call property needs to match the function
function d(x: { (): string; (x: number): string }): () => string {
return x;
}
// ...but you need at least one
function e(x: { (): string; (x: number): string }): () => number {
return x;
}