Help wantedbug
仓库指标
- 星标
- (5,369 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
psalm is inconsistent in when it says "RedundantCondition" on instanceof checks.
https://psalm.dev/r/377cb86ce7
interface I {}
class C {}
/**
* @param I $o
*/
function fI(I $o): void {
// Not redundant?
if ($o instanceof I) {
print 'yes';
}
}
/**
* @param C $o
*/
function fC(C $o): void {
// ERROR: RedundantCondition - 20:9 - Type C for $o is always C
if ($o instanceof C) {
print 'yes';
}
}