Files
test-repo/tests/flow/any/propagate.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

26 lines
466 B
JavaScript

// @flow
declare class C {
bar(n1: number, n2: number): number;
bar(s1: string, s2: string): string;
}
function foo(c: C, x: any): string {
let y = x.y;
return c.bar(0, y); // should be able to select first case and error
}
var any_fun1 = require('./nonflowfile');
function bar1(x: mixed) {
if (any_fun1(x)) {
(x: boolean);
}
}
var any_fun2 = require('./anyexportflowfile');
function bar2(x: mixed) {
if (any_fun2(x)) {
(x: boolean);
}
}