You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
transpiler: fix absolute path qualification for shadowed module function calls
When code inside `tests::parser` calls functions from the outer
`parser` module (e.g., `from_str<TestFlags>(s)` or `to_writer(f, &s)`),
C++ name lookup found the inner `tests::parser` namespace instead.
Fix: emit absolute paths (`::parser::from_str<T>(...)`) when a
single-segment function call matches a function in
`module_qualified_functions` and the module prefix is shadowed by a
same-named namespace in the current scope. Also handles multi-segment
paths (`parser::from_str<T>(...)` → `::parser::from_str<T>(...)`).
Bitflags compilation errors: 447 → 363 (84 fewer). All namespace
collision errors from architecture gap #7 are now resolved.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: TODO.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2592,7 +2592,7 @@ Work on tasks defined in TODO.md. Repeat the following steps, don’t stop until
2592
2592
- [x] *done* Leaf 1.1: Pre-scan all items to detect inline module names that collide with function names anywhere in the file; rename colliding namespaces by appending `_tests` suffix
2593
2593
- [x] *done* Leaf 1.2: Apply renames consistently in forward declarations, full namespace body emission, and test wrapper call paths via `escape_and_rename_qualified_name()`
2594
2594
- [x] *done* Leaf 1.3: Add regression test for namespace/function collision rename pattern
2595
-
- [ ] Leaf 1.4: Fix remaining path resolution for function calls inside renamed scopes — `from_str<T>(s)` inside `tests::parser` can't find `::parser::from_str<B>()` by unqualified lookup; needs either `using namespace ::parser;` injection or absolute path qualification
2595
+
- [x] *done* Leaf 1.4: Fix path resolution for function calls inside renamed scopes — emit absolute `::parser::from_str<T>(...)` paths when calling functions from a parent module whose name is shadowed by a same-named namespace in the current scope. Handles both turbofish and non-turbofish calls. Bitflags errors: 447 → 363 (84 fewer).
- [ ] Leaf 2.1: Detect `let (a, b) = expr` where expr returns void or incomplete type and emit explicit typed bindings or skip destructuring
2598
2598
- [ ] Leaf 2.2: Add regression tests for structured bindings from functions returning tuples vs void
@@ -2630,7 +2630,7 @@ Work on tasks defined in TODO.md. Repeat the following steps, don’t stop until
2630
2630
- [x] *done* Leaf 12.1: Detect when expanded test code creates sub-modules with the same name as function templates and apply `_tests` suffix to test sub-module namespaces (done in Leaf 1.1)
2631
2631
- [x] *done* Leaf 12.2: Update test wrapper call paths to use renamed test namespaces (done in Leaf 1.2)
2632
2632
- [x] *done* Leaf 12.3: Add regression tests for namespace/function collision patterns (done in Leaf 1.3)
2633
-
- [ ] Leaf 12.4: Fix remaining unqualified function calls inside renamed scopes (see Leaf 1.4)
2633
+
- [x] *done* Leaf 12.4: Fix remaining unqualified function calls inside renamed scopes (done in Leaf 1.4)
2634
2634
- [ ] Leaf 13: Re-run parity matrix after all fixes and verify 7/7 crates pass
- [x] *done* Add an integration parity matrix test that runs `parity-test --stop-after run` for `either`, `tap`, `cfg-if`, `take_mut`, `arrayvec`, `semver`, and `bitflags`
0 commit comments