instanceof (and probably other) checks don't refine with direct boolean comparison
Abierto
bug
- Lenguaje dominante
- Rust
- Estrellas
- 22.3k
- Forks
- 1.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
`instanceof` always returns a boolean, depending on whether it's something is an instance of something or not.
works:
```js
class A {cool: () => {}}
class B {}
const a = new A
const what: A | B = a;
if (what instanceof A) {
what.cool();
}
```
doesn't:
```js
class A {cool: () => {}}
class B {}
const a = new A
const what: A | B = a;
if ((what instanceof A) === true) {
what.cool();
}
```
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.