Summary
Dot completion after generic calls can lose type information in the field-access resolver path.
While investigating a separate completion inconsistency, I noticed this generic-call path has incomplete binding in getFieldAccessType. I added focused repro tests and confirmed the behavior.
Repro
const S = struct { alpha: u32 };
fn make(comptime T: type) T { return undefined; }
const foo = make(S).<cursor>
Expected behavior
Completion should include:
Actual behavior
Completion may be empty or miss expected members after the generic call result.
Suspected root cause
In src/analysis.zig, getFieldAccessType(...) call handling in the l_paren branch does not reliably preserve generic call argument bindings in this path.
There is already a related TODO in that area about binding call params:
src/analysis.zig (around call handling in getFieldAccessType)
Scope
This appears to be a semantic/type-resolution issue in dot completion, not primarily the parser-recovery umbrella tracked by #2346.
Additional context
A possible approach is to prefer AST-based call resolution when available, while keeping the token-based path as fallback for incomplete/invalid code during editing.
Summary
Dot completion after generic calls can lose type information in the field-access resolver path.
While investigating a separate completion inconsistency, I noticed this generic-call path has incomplete binding in getFieldAccessType. I added focused repro tests and confirmed the behavior.
Repro
Expected behavior
Completion should include:
alphaActual behavior
Completion may be empty or miss expected members after the generic call result.
Suspected root cause
In
src/analysis.zig,getFieldAccessType(...)call handling in thel_parenbranch does not reliably preserve generic call argument bindings in this path.There is already a related TODO in that area about binding call params:
src/analysis.zig(around call handling ingetFieldAccessType)Scope
This appears to be a semantic/type-resolution issue in dot completion, not primarily the parser-recovery umbrella tracked by #2346.
Additional context
A possible approach is to prefer AST-based call resolution when available, while keeping the token-based path as fallback for incomplete/invalid code during editing.