Object types intersection within generics within object types
Abierto
- Lenguaje dominante
- Rust
- Estrellas
- 22.3k
- Forks
- 1.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Trying to intersect object types within generics inside object types.
```
type C = {
beers: Array<{
brand: string
}>
}
type D = {
beers: Array<{
size: number
}>
}
type CD = C & D;
var cd: CD = {beers : [{brand: 'Rothhaus', size: 0.5}]}
```
The variable cd does not fit the type CD. Is this the expected behavior?
Althought it works with this example.
```
type beerWithBrand = {
brand: string
}
type beerWithSize = {
size: number
}
type beerStock = {
beers: Array
}
var stock : beerStock = {beers : [{brand: 'Rothhaus', size: 0.5}]}
```
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.