facebook / facebook/flow

indexer intersection regression

Aperta
#5,698 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
regression
Lingua principale
Rust
Stelle
22.3k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

For some reason I can't reproduce this in try flow; it only seems to be happening when I import the type declarations from one of my own packages.

The `oppositeOf` type below stopped working somewhere after Flow 0.56.0:
```js
// @flow

export type Axis = 'x' | 'y'
export type Side = 'left' | 'right' | 'top' | 'bottom'
export type Direction = 'left' | 'right' | 'up' | 'down'
export type Dimension = 'width' | 'height'

declare export var axes: Array
declare export var sides: Array
declare export var directions: Array
declare export var dimensions: Array

declare export var sideInDirection: {[direction: Direction]: Side}
declare export var directionOf: {[side: Side]: Direction}
declare export var signumOf: {[what: Side | Direction]: number}
declare export var axisFor: {[what: Side | Direction | Dimension]: Axis}
declare export var dimensionFor: {[what: Side | Direction | Axis]: Dimension}
declare export var oppositeOf:
{[side: Side]: Side} &
{[direction: Direction]: Direction} &
{[dimension: Dimension]: Dimension} &
{[axis: Axis]: Axis}
declare export var loSide: {[axis: Axis]: Side}
declare export var hiSide: {[axis: Axis]: Side}
declare export var negativeDirection: {[axis: Axis]: Direction}
declare export var positiveDirection: {[axis: Axis]: Direction}
```

### Reproduction
* `git clone https://github.com/jcoreio/react-arrow.git`
* `cd react-arrow`
* `git checkout 2519794250bdf24f26701f0356cf11bcb29c8278`
* `yarn`
* `yarn run flow` (no errors - flow 0.56.0)
* `flow stop`
* `yarn add --dev flow-bin@0.63.1`
* `yarn run flow`

### New errors
```
Error: src/index.js:83
83: const oaxis = oppositeOf[axis]
^^^^^^^^^^^^^^^^ string `x`. This type is incompatible with
19: {[side: Side]: Side} &
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:19

Error: src/index.js:83
83: const oaxis = oppositeOf[axis]
^^^^^^^^^^^^^^^^ string `y`. This type is incompatible with
19: {[side: Side]: Side} &
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:19

Error: src/index.js:89
89: bounds[loSide[oaxis]] = -headWidth / 2
^^^^^^^^^^^^^ string `bottom`. This type is incompatible with
23: declare export var loSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:23

Error: src/index.js:89
89: bounds[loSide[oaxis]] = -headWidth / 2
^^^^^^^^^^^^^ string `left`. This type is incompatible with
23: declare export var loSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:23

Error: src/index.js:89
89: bounds[loSide[oaxis]] = -headWidth / 2
^^^^^^^^^^^^^ string `right`. This type is incompatible with
23: declare export var loSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:23

Error: src/index.js:89
89: bounds[loSide[oaxis]] = -headWidth / 2
^^^^^^^^^^^^^ string `top`. This type is incompatible with
23: declare export var loSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:23

Error: src/index.js:90
90: bounds[hiSide[oaxis]] = headWidth / 2
^^^^^^^^^^^^^ string `bottom`. This type is incompatible with
24: declare export var hiSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:24

Error: src/index.js:90
90: bounds[hiSide[oaxis]] = headWidth / 2
^^^^^^^^^^^^^ string `left`. This type is incompatible with
24: declare export var hiSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:24

Error: src/index.js:90
90: bounds[hiSide[oaxis]] = headWidth / 2
^^^^^^^^^^^^^ string `right`. This type is incompatible with
24: declare export var hiSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:24

Error: src/index.js:90
90: bounds[hiSide[oaxis]] = headWidth / 2
^^^^^^^^^^^^^ string `top`. This type is incompatible with
24: declare export var hiSide: {[axis: Axis]: Side}
^^^^ string enum. See: node_modules/isotrope/lib/index.js.flow:24

Found 10 errors
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.