[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:74004] [Ruby trunk Bug#12113] Global method inside Delegator causes NameError
From:
oleg.b.antonyan@...
Date:
2016-02-26 09:17:32 UTC
List:
ruby-core #74004
Issue #12113 has been reported by Oleg Antonyan.
----------------------------------------
Bug #12113: Global method inside Delegator causes NameError
https://bugs.ruby-lang.org/issues/12113
* Author: Oleg Antonyan
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
~~~
def some_func
puts '12'
end
class Klass < Delegator
def initialize(obj)
@obj = obj
end
def __getobj__
@obj
end
def func
some_func #=> /home/oleg/.rbenv/versions/2.3.0/lib64/ruby/2.3.0/delegate.rb:85:in `instance_method': undefined method `some_func' for module `Kernel' (NameError)
end
end
Klass.new(0).func
~~~
Delegator uses Kernel.instance_method (https://github.com/ruby/ruby/blob/trunk/lib/delegate.rb#L85) but:
~~~
::Kernel.respond_to?(:some_func, true) #=> true
::Kernel.instance_method(:some_func) #=> `instance_method': undefined method `some_func' for module `Kernel' (NameError)
::Kernel.method(:some_func) #=> #<Method: Module(Object)#some_func>
~~~
I think there should be Kernel.method instead of instance_method (in Delegator). Otherwise you get respond_to? == true, but cannot use this method and get an error.
--
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>