Support overloading method signatures in object types
Đang mở
Typing: object model
- 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ả
I want to do something like this in Flow
```
type DifferentOutputs = {
doThing(name: 'number'): number;
doThing(name: 'Promise'): Promise;
}
function f(d: DifferentOutputs) {
var n: number = d.doThing('number');
}
```
This code is now rejected by Flow.
This logic is actually possible in flow - but only in the declaration files. See : https://github.com/facebook/flow/blob/master/lib/dom.js#L292-L310
I am not sure how to write this logic into my own types, and why it's possible only in external declarations.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.