IronRuby hosting: self becomes nil

Hello,

I get very odd results with attached code:


#System::Windows::Forms::Form:0x000005c
nil
#System::Windows::Forms::Form:0x000005e


While was expected


#System::Windows::Forms::Form:0x000005c
#System::Windows::Forms::Form:0x000005c
#System::Windows::Forms::Form:0x000005e


The ‘nil’ is printed by this expression:
form = form.test

and the test method definition is:

class Object
def test
p self
end
end

The hint: ‘form’ variable was set by the script host (SetVariable).

I am using DLR-0.9.

Thanks,

  • Alex

Hello,

Should I report this as IronRuby bug?

  • Alex

Yes, please.

Thanks,
Tomas

Submitted as Bug # 23512.

http://rubyforge.org/tracker/index.php?func=detail&aid=23512&group_id=4359&atid=16798

BTW, Tomas, thank you for your responses!

  • Alex