Issue #9155 has been updated by nobu (Nobuyoshi Nakada).


I prefer here but a pull request on github is also a correct place.

The reason I didn't merge it is:
* I didn't want to add another instance variable, and
* more importantly, a subclass of Delegator/DelegateClass may not call
  super in its __setobj__ method, and then the flag will be left unset.

----------------------------------------
Bug #9155: DelegateClass - ArgumentError: not delegated
https://bugs.ruby-lang.org/issues/9155#change-43423

Author: rhs (Russell Smith)
Status: Closed
Priority: High
Assignee: nobu (Nobuyoshi Nakada)
Category: 
Target version: current: 2.1.0
ruby -v: ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-darwin13.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Running the attached code gives ArgumentError: not delegated. It's unexpected as it worked on preview 1 and in 2.0.0. Error pasted below. https://gist.github.com/ukd1/9293c419a080d034f4bb - has sample code plus runs on 2.0.0p247 + 2.1.0-preview1 and 2.1.0-preview2

ArgumentError: not delegated
    from /Users/russ/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/delegate.rb:384:in `__getobj__'
    from /Users/russ/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/delegate.rb:77:in `method_missing'
    from (irb):5:in `initialize'
    from (irb):11:in `new'
    from (irb):11
    from /Users/russ/.rvm/rubies/ruby-2.1.0-preview2/bin/irb:11:in `<main>'


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