Recursively walk the AST to find function and method bodies, running the forward walker on each. Seed `$this` in the scope when inside a non-static class method. This creates a `ResolvedType` from the enclosing `ClassInfo` and stores it under `"$this"`. The scope-based variable resolver then returns this entry for any `$this` lookup, eliminating the need to remain unresolved.
(scope: &mut ScopeState, current_class: &ClassInfo)
| 1531 | /// returns this entry for any `$this` lookup, eliminating the need to |
| 1532 | /// remain unresolved. |
| 1533 | fn seed_this(scope: &mut ScopeState, current_class: &ClassInfo) { |
| 1534 | if current_class.name.is_empty() { |
| 1535 | return; |
| 1536 | } |
| 1537 | scope.set( |
| 1538 | "$this", |
| 1539 | vec![ResolvedType::from_class(current_class.clone())], |
| 1540 | ); |
| 1541 | } |
| 1542 | |
| 1543 | /// Walk a sequence of top-level (or namespace-level) statements, |
| 1544 | /// maintaining a shared `ScopeState` for code that lives outside any |
no test coverage detected