Commit 7fb4a37
Fix phpstan/phpstan#11488: count() narrowing on union of constant arrays
- Fixed specifyTypesForCountFuncCall falsey context to build complement types directly
instead of removing matching types, avoiding structural subtyping issues with
TypeCombinator::remove
- Added regression test in tests/PHPStan/Analyser/nsrt/bug-11488.php1 parent a3fb8e9 commit 7fb4a37
2 files changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
1277 | | - | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1278 | 1283 | | |
1279 | 1284 | | |
1280 | 1285 | | |
1281 | | - | |
| 1286 | + | |
1282 | 1287 | | |
1283 | 1288 | | |
1284 | 1289 | | |
| |||
1371 | 1376 | | |
1372 | 1377 | | |
1373 | 1378 | | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
1374 | 1386 | | |
1375 | 1387 | | |
1376 | 1388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments