mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
14 lines
286 B
JavaScript
14 lines
286 B
JavaScript
// @flow
|
|
|
|
// from sam, https://github.com/facebook/flow/issues/780
|
|
// call to f() within if should properly havoc x.
|
|
//
|
|
function example(b: bool): number {
|
|
var x = 0;
|
|
function f() { x = "" }
|
|
if (b) {
|
|
f();
|
|
}
|
|
return x; // error, string ~/~> number (return type anno) TODO
|
|
}
|