Repository navigation
Commit 2c685d6
committed
feat(d5): merge same-name overloads in MOS instead of dropping them
The extractor names a call's callee `{Type}.{Method}` with no parameter
signature, so two overloads (e.g. C.M(Stream) / C.M(string)) collide on the
same MOS key and a forward to that name cannot pick an overload. The bridge
previously dropped every non-unique name from the skeleton set, so an
overloaded method got NO interprocedural summary at all — a forward to it
stayed `unknown` (a missed leak) and an overloaded factory was never seen as
fresh (note's open question §10 q2).
Merge same-name overloads into ONE conservative summary instead of dropping
(`_merge_skeletons`): a lattice join at (name, parameter-index) granularity —
a parameter transfers `must` only when EVERY overload carrying that index
consumes it (an overload that merely keeps the index contributes a `borrow`
path, so the join can never fabricate a `must`), and the return is the shared
kind only when all overloads agree (else `unknown`, never a fabricated
`fresh`). Sound and precision-safe; strictly better than dropping. Arg-type /
per-arity disambiguation would need call-site type info the fact stream does
not carry — documented as the residual.
Two bridge regression tests: agreeing overloads resolve a forward to consume
(caller OWN002, previously missed); disagreeing overloads join to `may` so the
caller stays silent (no fabricated must). ownir 196/196, mypy --strict, ruff.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019846YSZ35c7CdkWQ1qX5gm1 parent 4d39b69 commit 2c685d6
2 files changed
Lines changed: 95 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1299 | 1342 | | |
1300 | 1343 | | |
1301 | 1344 | | |
| |||
1320 | 1363 | | |
1321 | 1364 | | |
1322 | 1365 | | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1326 | 1371 | | |
1327 | | - | |
1328 | | - | |
| 1372 | + | |
| 1373 | + | |
1329 | 1374 | | |
1330 | 1375 | | |
1331 | 1376 | | |
1332 | | - | |
| 1377 | + | |
1333 | 1378 | | |
1334 | 1379 | | |
1335 | 1380 | | |
1336 | 1381 | | |
1337 | | - | |
| 1382 | + | |
1338 | 1383 | | |
1339 | 1384 | | |
1340 | 1385 | | |
| |||
1373 | 1418 | | |
1374 | 1419 | | |
1375 | 1420 | | |
1376 | | - | |
1377 | | - | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1378 | 1425 | | |
1379 | 1426 | | |
1380 | 1427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1341 | 1341 | | |
1342 | 1342 | | |
1343 | 1343 | | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1344 | 1383 | | |
1345 | 1384 | | |
1346 | 1385 | | |
| |||
0 commit comments