facebook / facebook/flow

intersection types behaving unexpectedly when used inside types vs classes

Aberta
#2,547 5 comentários 0 reações 0 responsáveis Ver no GitHub
Typing: unions/intersections
Linguagem predominante
Rust
Estrelas
22.3k
Forks
1.9k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

consider [this example](https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgCCYAvGAN5hRxwBcYAzhgE4CWAdgOZgC+A3JlwEAQqQpgARgENm9Jmy68Bg-GAAqeALY4YUjHgA8awgBp1wgHxjyqMGAAe9ABRT6xsADJzASlJWAbnCsACYmtmBYzq7qhL4kAUGhqDzoAMa6DAxgAEp47MF4zIVGpuZWNnb62rr6blo6eobGZmqWAnbhqXDs8gCuqRhwzE5VDbXq9TVNpa0WvhVgAJAYABasDAB0o1Ni243tvMlp3UxgGHXVjQalltbhjmBOlNRwZtLMvHHlPGF2kY-PGifPwUH7JZTsPBIXL5QqFEbePhAA) vs [this one](https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgCCYAvGAN5hRxwBcYAzhgE4CWAdgOZgC+A3JlwEAQqQpgARgENm9Jmy68BqAMYwpDBmAAqeALY51GPAB5tARgA0OgEwA+CqjBgAHvQAUU+hbAAyWwCUpA4AbnCsACYCzlgeXjrmQSSh4VFOYOkqcOzyAK4qGHDM7pQu1li8QeTpzhgAFqwMAHQuYi7RzmD1jU0VZFgdPKhDquqaYABKeOwReMxzZla2DtW1+oZSxt7rRqYW1tr2HZnZeQVF7sYGu9vXm3tLh3ZV6QCQ3c1XG8ZiX7uDw3QWRyGC6t2+pkI1mEDjI7DwSF0d2MJXSbjAJSoNGs0mYlWCFB4lnSsQxlGocHxyUJxJ4AWU8KQUxmczml3pQA)

The only thing changing between the two is that in the first case I use `type` and in the second I use `class`. For some reason the intersection inside the type throws an error. The same intersection inside a class (or even an interface) doesn't throw. I believe this is a bug

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.