Skip to content

Instantly share code, notes, and snippets.

@dfroger
Last active October 19, 2018 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfroger/81947b31b96913a71d60bb477c91928c to your computer and use it in GitHub Desktop.
Save dfroger/81947b31b96913a71d60bb477c91928c to your computer and use it in GitHub Desktop.
reproduce a bug in flow (0.83.0 for example)
// @flow
export class Bar {}
// @flow
import type { A } from './redux';
export type B = string;
export type C = string;
// @flow
import { Bar } from './bar';
import type { C } from './c';
export class Foo {
constructor(bar: Bar) {}
}
// @flow
import { Bar } from './bar';
import { Foo } from './foo';
export const bar = new Bar();
export const foo = new Foo(bar);
// @flow
import type { B } from './c';
import type { Foo } from './foo';
export type Action = { type: 'ACTION1' } | { type: 'ACTION2', foo: Foo };
export type A = string;
const reducer = (action: Action): number => action.type === 'ACTION1' ? 1 : 2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment