Skip to content

refactor(stacktrace): Change StackFrame.line from usize to Option<usize>#83

Merged
romtsn merged 2 commits intorz/feat/r8-tests-line-number-handlingfrom
rz/fix/r8-tests-option-line-type
Feb 16, 2026
Merged

refactor(stacktrace): Change StackFrame.line from usize to Option<usize>#83
romtsn merged 2 commits intorz/feat/r8-tests-line-number-handlingfrom
rz/fix/r8-tests-option-line-type

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Feb 6, 2026

Summary

  • Changes StackFrame.line from usize to Option<usize> to distinguish "no line info" (None) from "line 0" (Some(0))
  • This is a prerequisite for correctly handling R8's various no-line mapping semantics
  • All call sites updated with unwrap_or(0) to preserve current behavior; no semantic changes

Test plan

  • All existing tests pass (no regressions)
  • test_multiple_lines_no_line_number_stacktrace now passes as a bonus (was previously failing)
  • 5 known-failing r8-line-number-handling tests remain (will be fixed in subsequent PRs)

🤖 Generated with Claude Code

@romtsn romtsn requested a review from loewenheim February 9, 2026 16:30
@romtsn romtsn force-pushed the rz/fix/r8-tests-option-line-type branch from 74783ef to 4921149 Compare February 10, 2026 09:55
Base automatically changed from rz/feat/r8-tests-invalid-range-normalization to rz/feat/r8-tests-line-number-handling February 16, 2026 09:31
Distinguish "no line info" (None) from "line 0" (Some(0)) in stack
frames. This is a prerequisite for correctly handling R8's various
no-line mapping semantics where the absence of line information has
different behavior than an explicit line 0.

- StackFrame::new/with_file wrap line in Some()
- StackFrame::with_parameters uses None instead of 0
- parse_frame returns None for missing line, Some(n) for present line
- Display omits `:line` suffix when line is None
- All call sites updated with unwrap_or(0) to preserve current behavior
- All test assertions updated to use Some(N)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@romtsn romtsn force-pushed the rz/fix/r8-tests-option-line-type branch from 4921149 to 532c271 Compare February 16, 2026 09:39
@romtsn romtsn merged commit f132a33 into rz/feat/r8-tests-line-number-handling Feb 16, 2026
4 of 6 checks passed
@romtsn romtsn deleted the rz/fix/r8-tests-option-line-type branch February 16, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants