facebook / facebook/flow

Intersection fails if more specific type comes last, again

Đang mở
#2,697 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
Typing: unions/intersections
Ngôn ngữ chính
Rust
Star
22.3k
Fork
1.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This is kind of a dup of https://github.com/facebook/flow/issues/2074, except it's not. That issue says that in the code below FooBar type would behave as Foo, however it produces an error. The reason for the error is not clear since the value satisfies both types.

type Foo = {
type: string,
};

type Bar = {
type: 'specific',
};

type FooBar = Foo & Bar;

({type: 'specific'} : FooBar); // error

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.