Actions
Bug #21027
closed
`not()` receiver should be `nil`
Description
not
has a 0-argument mode, and the behavior differs from that of parse.y:
% RBENV_VERSION=3.4.0 ruby --parser=parse.y -e 'p not()'
true
% RBENV_VERSION=3.4.0 ruby --parser=prism -e 'p not()'
false
This is because Prism interprets not()
as self.!
where parse.y interprets it as nil.!
.
Updated by kddnewton (Kevin Newton) 2 months ago
- Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED
Updated by kddnewton (Kevin Newton) 2 months ago
- Status changed from Open to Closed
Applied in changeset git|117d6e145a0270ab8fc9134403519ef13b9ebb24.
[ruby/prism] Fix not
receiver
not foo
should be !foo
not()
should be !nil
Fixes [Bug #21027]
Updated by k0kubun (Takashi Kokubun) 28 days ago
- Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE
ruby_3_4 c989d90754edeefa4e692d2cd8c351394cb217e7 merged revision(s) 117d6e145a0270ab8fc9134403519ef13b9ebb24.
Actions
Like0
Like0Like0Like0