From: usa@... Date: 2021-02-28T15:04:51+00:00 Subject: [ruby-core:102664] [Ruby master Bug#11143] it should always be possible to return from an if Issue #11143 has been updated by usa (Usaku NAKAMURA). Backport changed from 2.5: REQUIRED, 2.6: REQUIRED to 2.5: REQUIRED, 2.6: DONE Backported into ruby_2_6 at r67903. ---------------------------------------- Bug #11143: it should always be possible to return from an if https://bugs.ruby-lang.org/issues/11143#change-90658 * Author: bughit (bug hit) * Status: Closed * Priority: Normal * Backport: 2.5: REQUIRED, 2.6: DONE ---------------------------------------- ``` irb(main):001:0> def foo; a = if true then return end end SyntaxError: (irb):1: void value expression ``` it should not matter that you are not producing a value for the if expression, since you are leaving the method immediately. This should also apply to other jumps. -- https://bugs.ruby-lang.org/ Unsubscribe: