-X:PrivateBinding does not enable referring to classes that have internal visibility


specifying option -X:PrivateBinding does enable one to invoke methods with internal (or private) visibility, but it fails if the class containing the method is of internal visibility. This forces setting the class public to be able to write a unit test for it in Ruby.
The error is
NameError: uninitialized constant NapaLicensingTest::LICWrapper
The error does not occur if the class is public.
My guess would be that IronRuby does not take into account this option being set when creating a list of classes contained in a loaded .net dll.
Closed Jul 24, 2009 at 7:17 PM by jredville
spec added


TomasMatousek wrote Jun 12, 2009 at 1:40 AM

I assume the LICWrapper class is a nested class of NapaLicensingTest. I've fixed that case (wait until next source code push to try).
In case of a simple internal class on top level it worked before just right.

wrote Jun 12, 2009 at 1:40 AM

akaranta wrote Jun 12, 2009 at 6:04 AM

Sorry for not providing enough detail.

No, LICWrapper is not a nested class. It's a normal C# (static) class whose namespace I included. Here's the relevant parts of the ironruby code:

include Napa::Legacy::NativeAccess # this is the namespace LICWrapper lives in

class NapaLicensingTest < NapaTestCase # NapaTestCase is a subclass of Test::Unit::TestCase
def setup
    if !LICWrapper.is_debug_build


I'll give your fix a spin once I get my hands on a build containing it. Unfortunately GIT refuses to work on my system so I can't build from the latest sources. :/

wrote Jul 24, 2009 at 7:17 PM

wrote Dec 7, 2009 at 10:25 PM

wrote Feb 21, 2013 at 11:40 PM

wrote May 16, 2013 at 11:05 AM