Project

General

Profile

ActionsLike0

Bug #20464

open

Redundant returns are unreachable in coverage

Added by kddnewton (Kevin Newton) about 1 year ago. Updated about 1 year 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 - Bug #20457: Final `return` is eliminated from the ASTClosedActions
#5

Updated by mame (Yusuke Endoh) about 1 year ago

  • Related to Bug #20457: Final `return` is eliminated from the AST added
ActionsLike0

Also available in: Atom PDF