[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
Issue #13188 has been updated by Shyouhei Urabe.
6 messages
2017/02/06
[#79441] Re: [Ruby trunk Bug#13188] Reinitialize Ruby VM.
— SASADA Koichi <ko1@...>
2017/02/06
On 2017/02/06 10:10, shyouhei@ruby-lang.org wrote:
[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>
Hi,
15 messages
2017/02/15
[#79541] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/15
Em 15-02-2017 05:05, Daniel Ferreira escreveu:
[#79543] Re: Immutable Strings vs Symbols
— Daniel Ferreira <subtileos@...>
2017/02/16
Hi Rodrigo,
[#79560] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/16
Em 15-02-2017 22:39, Daniel Ferreira escreveu:
[ruby-core:79664] [Ruby trunk Feature#13083] {String|Symbol}#match{?} with nil returns falsy as Regexp#match{?}
From:
matz@...
Date:
2017-02-22 07:39:06 UTC
List:
ruby-core #79664
Issue #13083 has been updated by Yukihiro Matsumoto.
Those methods (but `=~`) should consistently raise exceptions.
Matz.
----------------------------------------
Feature #13083: {String|Symbol}#match{?} with nil returns falsy as Regexp#match{?}
https://bugs.ruby-lang.org/issues/13083#change-63083
* Author: Kenichi Kamiya
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Just for consistency
* patch: https://github.com/ruby/ruby/pull/1506
* spec: https://github.com/ruby/spec/pull/380
Currently behaves as ( ruby --version: ruby 2.5.0dev (2016-12-28 trunk 57228) [x86_64-darwin16] )
~~~ ruby
'string'.__send__(:=~, nil) #=> nil
'string'.match(nil) #=> TypeError: wrong argument type nil (expected Regexp)
'string'.match?(nil) #=> TypeError: wrong argument type nil (expected Regexp)
:symbol.__send__(:=~, nil) #=> nil
:symbol.match(nil) #=> TypeError: wrong argument type nil (expected Regexp)
:symbol.match?(nil) #=> TypeError: wrong argument type nil (expected Regexp)
/regex/.__send__(:=~, nil) #=> nil
/regex/.match(nil) #=> nil
/regex/.match?(nil) #=> false
~~~
Expected to
~~~ruby
'string'.__send__(:=~, nil) #=> nil
'string'.match(nil) #=> nil
'string'.match?(nil) #=> false
:symbol.__send__(:=~, nil) #=> nil
:symbol.match(nil) #=> nil
:symbol.match?(nil) #=> false
/regex/.__send__(:=~, nil) #=> nil
/regex/.match(nil) #=> nil
/regex/.match?(nil) #=> false
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>