Skip to main content

Module position

Module position 

Source
Expand description

Source positions attached to TypeErrors (#306 slice 1).

LLM-driven repair flows need errors that point at a concrete file:line:col, not just a NodeId. Position carries that triple; TypeError variants gain an Option<Position> that the type checker fills in via check_program_with_positions.

Slice 1 ships function-level granularity: every error from a given fn is stamped with that function’s start position. Slice 1.5 will plumb per-expression spans through the canonicalizer so deep-body errors land on the offending sub-expression.

Structs§

Position

Functions§

byte_to_line_col
Translate a byte offset into the source string into a 1-based (line, col). Lines split on \n; columns count chars (not bytes), so multi-byte UTF-8 doesn’t double-count. Out-of-range offsets clamp to end-of-source.