Commit 60692c8
committed
Fix type_name_lookup so top-level classes win over nested namesakes
Skipping the ambiguity check when `cm.name == cm.full_name` let a nested
class (e.g. `Gem::SafeMarshal::Elements::String`) register itself as the
unqualified `String` in `unqualified_names`, which then overwrote the
core `String` entry during the final `lookup.merge!`. Remove the skip so
top-level classes participate in ambiguity detection — the second
sighting now correctly marks the name ambiguous and deletes it from
`unqualified_names`, leaving `lookup["String"]` pointing at the core
class's path.1 parent 80a336a commit 60692c8
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1355 | 1372 | | |
1356 | 1373 | | |
1357 | 1374 | | |
| |||
0 commit comments