ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:69064] [Ruby trunk - Bug #11117] [Open] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
       [not found] <redmine.issue-11117.20150503191647@ruby-lang.org>
@ 2015-05-03 19:16 ` jakub
  2015-05-08  4:22 ` [ruby-core:69098] [Ruby trunk - Bug #11117] " nobu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: jakub @ 2015-05-03 19:16 UTC (permalink / raw)
  To: ruby-core

Issue #11117 has been reported by Jakub Jirutka.

----------------------------------------
Bug #11117: When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
https://bugs.ruby-lang.org/issues/11117

* Author: Jakub Jirutka
* Status: Open
* Priority: High
* Assignee: 
* ruby -v: 2.2.2p95
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I’ve run into a very strange bug with refinements. Let me show you:

~~~ruby
module Ref
  refine String do
    def to_regexp
    end
  end
end

Regexp.try_convert('foo')
# or Regexp.union('foo', 'bar')
~~~

~~~
bug.rb:8:in `try_convert': undefined method `to_regexp' for "foo":String (NoMethodError)
	from test.rb:8:in `<main>'
~~~

Note that the refinement is not used (_using_), only declared, and yet it has affected behaviour of the refined class! This problem occurs only when the method is named `to_string`. It seems that there’s some serious scoping issue with refinements.

I’ve reproduced this issue on MRI 2.2.2p95, 2.1.5p273, and 2.0.0p598.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:69098] [Ruby trunk - Bug #11117] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
       [not found] <redmine.issue-11117.20150503191647@ruby-lang.org>
  2015-05-03 19:16 ` [ruby-core:69064] [Ruby trunk - Bug #11117] [Open] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used jakub
@ 2015-05-08  4:22 ` nobu
  2015-07-03  8:56 ` [ruby-core:69853] " usa
  2015-07-03 19:45 ` [ruby-core:69864] " nagachika00
  3 siblings, 0 replies; 4+ messages in thread
From: nobu @ 2015-05-08  4:22 UTC (permalink / raw)
  To: ruby-core

Issue #11117 has been updated by Nobuyoshi Nakada.

Priority changed from High to Normal
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED

----------------------------------------
Bug #11117: When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
https://bugs.ruby-lang.org/issues/11117#change-52342

* Author: Jakub Jirutka
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.2p95
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
I’ve run into a very strange bug with refinements. Let me show you:

~~~ruby
module Ref
  refine String do
    def to_regexp
    end
  end
end

Regexp.try_convert('foo')
# or Regexp.union('foo', 'bar')
~~~

~~~
bug.rb:8:in `try_convert': undefined method `to_regexp' for "foo":String (NoMethodError)
	from test.rb:8:in `<main>'
~~~

Note that the refinement is not used (_using_), only declared, and yet it has affected behaviour of the refined class! This problem occurs only when the method is named `to_string`. It seems that there’s some serious scoping issue with refinements.

I’ve reproduced this issue on MRI 2.2.2p95, 2.1.5p273, and 2.0.0p598.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:69853] [Ruby trunk - Bug #11117] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
       [not found] <redmine.issue-11117.20150503191647@ruby-lang.org>
  2015-05-03 19:16 ` [ruby-core:69064] [Ruby trunk - Bug #11117] [Open] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used jakub
  2015-05-08  4:22 ` [ruby-core:69098] [Ruby trunk - Bug #11117] " nobu
@ 2015-07-03  8:56 ` usa
  2015-07-03 19:45 ` [ruby-core:69864] " nagachika00
  3 siblings, 0 replies; 4+ messages in thread
From: usa @ 2015-07-03  8:56 UTC (permalink / raw)
  To: ruby-core

Issue #11117 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED

ruby_2_1 r51119 merged revision(s) 50430,50440.

----------------------------------------
Bug #11117: When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
https://bugs.ruby-lang.org/issues/11117#change-53254

* Author: Jakub Jirutka
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.2p95
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED
----------------------------------------
I’ve run into a very strange bug with refinements. Let me show you:

~~~ruby
module Ref
  refine String do
    def to_regexp
    end
  end
end

Regexp.try_convert('foo')
# or Regexp.union('foo', 'bar')
~~~

~~~
bug.rb:8:in `try_convert': undefined method `to_regexp' for "foo":String (NoMethodError)
	from test.rb:8:in `<main>'
~~~

Note that the refinement is not used (_using_), only declared, and yet it has affected behaviour of the refined class! This problem occurs only when the method is named `to_string`. It seems that there’s some serious scoping issue with refinements.

I’ve reproduced this issue on MRI 2.2.2p95, 2.1.5p273, and 2.0.0p598.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:69864] [Ruby trunk - Bug #11117] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
       [not found] <redmine.issue-11117.20150503191647@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-07-03  8:56 ` [ruby-core:69853] " usa
@ 2015-07-03 19:45 ` nagachika00
  3 siblings, 0 replies; 4+ messages in thread
From: nagachika00 @ 2015-07-03 19:45 UTC (permalink / raw)
  To: ruby-core

Issue #11117 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

Backported into `ruby_2_2` branch at r51133.

----------------------------------------
Bug #11117: When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used
https://bugs.ruby-lang.org/issues/11117#change-53268

* Author: Jakub Jirutka
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.2p95
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
I’ve run into a very strange bug with refinements. Let me show you:

~~~ruby
module Ref
  refine String do
    def to_regexp
    end
  end
end

Regexp.try_convert('foo')
# or Regexp.union('foo', 'bar')
~~~

~~~
bug.rb:8:in `try_convert': undefined method `to_regexp' for "foo":String (NoMethodError)
	from test.rb:8:in `<main>'
~~~

Note that the refinement is not used (_using_), only declared, and yet it has affected behaviour of the refined class! This problem occurs only when the method is named `to_string`. It seems that there’s some serious scoping issue with refinements.

I’ve reproduced this issue on MRI 2.2.2p95, 2.1.5p273, and 2.0.0p598.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-03 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-11117.20150503191647@ruby-lang.org>
2015-05-03 19:16 ` [ruby-core:69064] [Ruby trunk - Bug #11117] [Open] When you refine String with to_regexp, then it breaks Regexp.try_convert even when the refinement is not used jakub
2015-05-08  4:22 ` [ruby-core:69098] [Ruby trunk - Bug #11117] " nobu
2015-07-03  8:56 ` [ruby-core:69853] " usa
2015-07-03 19:45 ` [ruby-core:69864] " nagachika00

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).