Skip to content

Instantly share code, notes, and snippets.

@Bannerets
Last active July 28, 2018 10:18
Show Gist options
  • Save Bannerets/f3ad3ebc12840dc3f444938b4b7d9472 to your computer and use it in GitHub Desktop.
Save Bannerets/f3ad3ebc12840dc3f444938b4b7d9472 to your computer and use it in GitHub Desktop.
flow wtf #1
[ignore]
[include]
[libs]
[lints]
[options]
// @flow
// file1.js
export type Inc<N> = $Call<
& (0 => 1)
& (1 => 2)
& (2 => 3)
& (3 => 4), N>
export type Dec<N> = $Call<
& (1 => 0)
& (2 => 1)
& (3 => 2)
& (4 => 3), N>
// @flow
// file2.js
import type { Inc, Dec } from './file1'
type A = Inc<Inc<0>>
;(2: A) // 2, correct
type B = Dec<A>
;(1: B) // error?
;(0: B) // no error. 0? wtf?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment