Files
test-repo/tests/flow/singleton/number.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

24 lines
363 B
JavaScript

/* @flow */
function highlander(howMany: 1): number {
return howMany; // there can be only one!
}
highlander(1);
highlander(2); // error
type Foo = 1 | 2
function bar(num: Foo): number {
return num + 1;
}
bar(1);
bar(2);
bar(3); // error
type ComparatorResult = -1 | 0 | 1
function sort(fn: (x: any, y: any) => ComparatorResult) {}
sort((x, y) => -1);