// @flow

/**
 * Test that shows how the implementation of union types is broken
 */

////////////////
// interference
////////////////

function square(x?: number = 0) {
  return x * x;
}

function foo(f: ((_: ?number) => ?number) | (() => void)) { }
foo((x): number => square(x))
