indexer intersection regression
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
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
```
Contributor guide
Assessment
This issue has not been assessed yet.