Commit fe6b07d
SymDB: skip subclass+autoload test on Ruby < 2.7
The "subclass with constant of same name as ancestor pending autoload"
test verifies that resolves_to_same_module? distinguishes a real
subclass binding from an ancestor's pending autoload. That distinction
requires Module#autoload?(name, false) to query autoloads registered
directly on a namespace without checking ancestors. The `inherit`
parameter was added in Ruby 2.7 (Ruby 2.7.0 NEWS).
On Ruby 2.5/2.6 the implementation falls back to Module#autoload?(name)
which checks ancestors — so a subclass binding that collides with an
ancestor's pending autoload is conservatively treated as stale and
dropped. That fallback is documented in resolves_to_same_module?'s YARD
comment and is unavoidable without the 2.7+ API.
Skip the test on Ruby < 2.7 to align verification with the platform
that supports the asserted behavior. The conservative-fallback behavior
on 2.5/2.6 is already exercised by every leaked-class case in
collect_extractable_modules.
Co-Authored-By: Claude <[email protected]>1 parent 8f6a5d7 commit fe6b07d
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2337 | 2337 | | |
2338 | 2338 | | |
2339 | 2339 | | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
2340 | 2351 | | |
2341 | 2352 | | |
2342 | 2353 | | |
| |||
0 commit comments