Consider dropping empty type parameter list with default params
Open
feature request
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Currently if you have a type with a param that has a default:
```js
type Foo = {};
```
You are required to add `<>` even when you want to add that default:
```js
type Bar1 = Foo; // error
type Bar2 = Foo<>; // works
```
It's not been intuitive in my experience, and syntactically it's not obvious this is necessary.
In the AST, all this adds is an empty `TypeParameterInstantiation` inside of the existing `GenericTypeAnnotation`.
When resolving the generic, I'm wondering if Flow could treat the plain GenericTypeAnnotation as having a TypeParameterInstantiation when the targeted type doesn't require any type params to be provided
Contributor guide
Assessment
This issue has not been assessed yet.