bad property not found error related to spread props, object intersections, and import type order
- Vorherrschende Sprache
- Rust
- Sterne
- 22.3k
- Forks
- 1.9k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Flow 0.36.0
`temp1.js`
```es6
// @flow
export type BaseAxisProps = {
side: string,
}
export type AxisProps = BaseAxisProps & {
range: Array
}
```
`temp2.js`
```es6
// @flow
import type {AxisProps, BaseAxisProps} from './temp1'
// if you use this order instead, the error goes away!
// import type {BaseAxisProps, AxisProps} from './temp1'
type UncontrolledAxisProps = BaseAxisProps & {defaultRange: Array}
function convert(axis: UncontrolledAxisProps): AxisProps {
return {
...axis,
range: axis.defaultRange,
}
}
```
```
temp1.js:7
7: export type AxisProps = BaseAxisProps & {
^^^^^^^^^^^^^ property `side`. Property not found in
11: return {
^ object literal. See: temp2.js:11
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.