instanceof (and probably other) checks don't refine with direct boolean comparison
Open
bug
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
`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();
}
```
Contributor guide
Assessment
This issue has not been assessed yet.