Project

General

Profile

Bug #10947

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

Here is an invalid multiline if statement 

 ~~~ruby 
 if (false && 
     false && 
     false 
     true) 
     puts "I was expecting an exception but saw this message instead" 
 end 
 ~~~ 

 As far as I can tell this is and should never be interpreted as valid syntax. 

 What actually happens is instead of raising an exception, ruby ignores all values except the last and only evaluates that. If you forget a `&&` && at the end of a line this can result in very unexpected behavior.

Back