Project

General

Profile

Actions

Bug #20464

open

Redundant returns are unreachable in coverage

Added by kddnewton (Kevin Newton) about 2 months ago. Updated about 2 months ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:117750]

Description

With the following code:

def meth_return(a)
  return if a
  return
end

If you run coverage on it, it's not possible for it to hit line 3, because there isn't a line event, because the return node was eliminated from the AST before it was compiled. There is a putnil instruction, so it's possible for us to attach a line event for it, but the compiler doesn't today.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #20457: Final `return` is eliminated from the ASTClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0