mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
compile_class_body passed firstlineno to source_line_start_range. When the AST carries an AstLocations table, firstlineno comes from the table, while source_line_start_range indexes the source text. A table line past the end of the text panicked in ruff_source_file's line index. compile_class_def now also computes the text line that the first-line span starts on and passes it to compile_class_body for the range. The location still uses firstlineno. Without a location table the two are the same line. Assisted-by: Claude