Seed a closure/arrow function scope with parameter types, using inferred callable types as fallback for untyped parameters. This mirrors [`seed_params`] but additionally accepts `inferred_types` from the enclosing call's callable signature. When a parameter has no explicit type hint, the corresponding inferred type (matched by positional index) is used instead. Check whether a `/** … */` docbloc
(content: &str, fn_offset: usize)
| 786 | /// sibling closures/arrow functions from leaking across statement |
| 787 | /// boundaries. |
| 788 | fn is_docblock_adjacent(content: &str, fn_offset: usize) -> bool { |
| 789 | let before = match content.get(..fn_offset) { |
| 790 | Some(s) => s, |
| 791 | None => return false, |
| 792 | }; |
| 793 | // Walk backward over whitespace, then over optional keywords |
| 794 | // (`static`, visibility modifiers) that may sit between the |
| 795 | // docblock and `fn`. |
| 796 | let trimmed = before.trim_end(); |
| 797 | if trimmed.ends_with("*/") { |
| 798 | return true; |
| 799 | } |
| 800 | // Allow `static` keyword between docblock and `fn(…)`: |
| 801 | // /** @param T $x */ static fn(T $x) => … |
| 802 | // Also allow the `function` keyword for regular closures. |
| 803 | let trimmed = trimmed |
| 804 | .trim_end_matches(|c: char| c.is_ascii_alphanumeric() || c == '_') |
| 805 | .trim_end(); |
| 806 | trimmed.ends_with("*/") |
| 807 | } |
| 808 | |
| 809 | fn seed_closure_params( |
| 810 | scope: &mut ScopeState, |
no test coverage detected