From: merch-redmine@... Date: 2019-07-09T15:56:52+00:00 Subject: [ruby-core:93642] [Ruby master Bug#10463] :~@ and :!@ are not parsed correctly Issue #10463 has been updated by jeremyevans0 (Jeremy Evans). nobu (Nobuyoshi Nakada) wrote: > If `:!@` and `:!` are different things, also `!foo` and `foo.!` are different things. I don't believe that is true. With the above patch: ```ruby class A def !; :! end def ~; :~ end end !A.new # :! A.new.! # :! ~A.new # :~ A.new.~ # :~ ``` The `@` in `:!@` and `def !@; end` was ignored during lexing before, it doesn't affect the semantics. This is different than `+@` and `+`: ```ruby class A def +; :+ end def +@; :+@ end end +A.new # :+@ A.new.+ # :+ ``` > This means a backward incompatibility. The backward incompatibility should be limited to making the following invalid syntax: ```ruby def !@; end def ~@; end alias foo !@ alias bar ~@ :!@ :~@ ``` Currently, `:!@` is different than `:"!@"`, which very much appears to be a bug. With the above patch `:!@` is a syntax error (`:"!@"` is still valid). ---------------------------------------- Bug #10463: :~@ and :!@ are not parsed correctly https://bugs.ruby-lang.org/issues/10463#change-79250 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.1.4 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- The at mark in literal symbols `:~@` and `:!@` are ignored. ~~~ruby :~@ # => :~ :!@ # => :! ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: