berkesokhan / rubydotnetcompiler

Automatically exported from code.google.com/p/rubydotnetcompiler
1 stars 0 forks source link

Accessing protected method of an argument within a static method should raise exception #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
## Adapted from IronRuby tests: Runtime\Class\test_access_ctrl.rb
class C
    protected
    def prot_im
        true
    end

    public
    def C.static(x)
        x.prot_im   ## should raise NoMethodError
    end
end

c = C.new
C.static(c)

Protected instance method of an argument should not be accessible from
within a static method of the same class. The above code should raise a
NoMethodError, but Ruby.NET instead invokes the method.

Original issue reported on code.google.com by meaningi...@gmail.com on 30 Aug 2007 at 4:46

GoogleCodeExporter commented 9 years ago

Original comment by meaningi...@gmail.com on 2 Nov 2007 at 6:31