[mono-vb] VBNC30390 Compile Error

John Lenz jlenz2 at math.uiuc.edu
Fri Apr 17 10:25:18 EDT 2009


On 04/17/2009 03:09 AM, Rolf Bjarne Kvinge wrote:
> Hi,
> 
>> When attempting to compile a large vb.net project here at work with
>> mono, I got a really weird error.  I was able to strip it down to the
>> attached file, the error comes about when there are two private
>> subclasses of some class.
>>
>> I am using the mono-basic code from Mono 2.4, and I get the following
>> error.   The file compiles without errors in Visual Studio.  As I
>> mention
>> in the comment, changing Bar to a public class makes the file compile
>> without any errors.
>>
>>
>> Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4 - r) Copyright
>> (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.
>>
>> /home/john/test.vb (28,26) : Error VBNC30390: 'Bar.Testing' is not
> accessible because it is 'Public'.
> 
> Yes, this is really weird.
> 
> However you seem to have forgotten to attach the file ;-)
> 

I attached it, but maybe the list killed the attachment.  Here it is inline

Option Strict On

Public Class Foo

  'Changing Bar to a public class fixes the problem
  Private Class Bar
    Public Function Testing() As Integer
          Return 12
    End Function
  End Class

  Private b As Bar

  Public Sub New()
    b = New Bar()
  End Sub


  Private Class Baz

     Private parent As Foo

     Public Sub New(ByVal p As Foo)
        parent = p
     End Sub

     Public Function Test(ByVal i As Integer) As Integer
         Return parent.b.Testing() + i
     End Function

  End Class

  Public Function Test(ByVal i As Integer) As Integer
      Dim b As New Baz(Me)
      return b.Test(i)
  End Function
End Class


More information about the Mono-vb mailing list