facebook / facebook/flow

Intersection fails if more specific type comes last, again

Abierto
#2,697 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Typing: unions/intersections
Lenguaje dominante
Rust
Estrellas
22.3k
Forks
1.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.