Project

General

Profile

Actions

Feature #16755

open

warning: `if' at the end of line without an expression

Added by mpapis (Michal Papis) over 1 year ago. Updated over 1 year ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:97691]

Description

I'm using this notation in a lot of scripts:

if
  true
then
  puts :a
else
  puts :b
end

Using ruby 2.6.5 I'm getting expected response:

(0) 2.6.5 mpapis@mpapis-linux:~/tmp>ruby -w test.rb 
a

Using ruby 2.7.1 I'm getting extra warning:

(0) 2.7.1 mpapis@mpapis-linux:~/tmp>ruby -w test.rb 
test.rb:1: warning: `if' at the end of line without an expression
a

I've tracked it to the following git commits:

  • ba35c14325ebbf1da8f200df83c45ee9937ff8a1
  • c303854e134043d905baff2385add44cc2c28756
  • 26316cc350109ba71d42f944f3b976985627c042
  • e91e3274bebc803b97971ad0a6f4ee3a8c646a60
  • a087e027bf7cf0fbb825f1d55668f85ab1f3c9e6
  • 30a74aaef00a99364f5423439ac44babf5066dc0
Actions

Also available in: Atom PDF