From: sameer.deshmukh93@... Date: 2015-07-21T07:54:14+00:00 Subject: [ruby-core:70059] [Ruby trunk - Bug #11378] [Open] Syntax error when passing Array boolean logic into method Issue #11378 has been reported by Sameer Deshmukh. ---------------------------------------- Bug #11378: Syntax error when passing Array boolean logic into method https://bugs.ruby-lang.org/issues/11378 * Author: Sameer Deshmukh * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [i686-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Passing Array boolean logic into a method is yielding a syntax error when the opening parenthesis is not separated from the method name by a space. It works fine if there is a space or if the boolean logic is enclosed in parenthesis. Here's my sample code: ~~~ def meth arr puts arr end [17] pry(main)> meth([true,false,true] and [true,false,false]) # Produces error when parenthesis and method name dont have a space in between SyntaxError: unexpected ')', expecting end-of-input [17] pry(main)> meth(([true,false,true] and [true,false,false])) #Works fine true false false => nil [19] pry(main)> meth ([true,false,true] and [true,false,false]) # Works fine. Notice the space between method call and parenthesis true false false ~~~ -- https://bugs.ruby-lang.org/