Project

General

Profile

Actions

Bug #9251

closed

! operator has lower precedence than = in an assignment expression

Added by rits (First Last) over 10 years ago. Updated over 10 years ago.

Status:
Third Party's Issue
Target version:
-
ruby -v:
ruby 2.0.0p353 (2013-11-22 revision 43784) [i686-linux]
[ruby-core:59122]

Description

irb(main):001:0> !a = 1
(irb):1: warning: found = in conditional, should be ==
=> false
irb(main):002:0> a
=> 1

! is supposed to have higher precedence than =, so !a = 1 should be (!a) = 1, and thus an error, not !(a = 1)


Files

parse.y (1.28 KB) parse.y simplified grammar duerst (Martin Dürst), 12/17/2013 08:21 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0