Files
Benoit DalozeandClaude Opus 4.8 8040d06599 [Bug #22302] Emit a line event for a method's implicit nil return in parse.y
reduce_nodes eliminated a bare `nil` in a method's tail (value) position
down to an empty method body, so parse.y emitted no :line event and
recorded no line coverage for that line, even though it is executed:

    def m
      nil    # <- no :line event, no coverage under parse.y
    end

The Prism compiler keeps the explicit nil and correctly emits the event.
Keep the nil in reduce_nodes when it carries a newline flag (i.e. it is
on its own line) so it still produces a line event, while the implicit
nil of an empty body (no newline flag) is still dropped. This makes
parse.y match Prism for TracePoint :line events and line coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 23:42:44 +02:00
..
2023-01-22 13:49:13 +13:00