// @flow function foo(x: ?string): $NonMaybeType { if (x != null) { return x; } else return 0; // this should be an error } //(foo(): string); // should not be necessary to expose the error above (0: $NonMaybeType); // error (0: $NonMaybeType); // ok (0: $NonMaybeType); // ok