' Visual Basic .NET Document Option Strict On ' Public Class C1(Of T) Protected Class N End Class Protected Sub M1(n As C1(Of Integer).N) ' Not CLS-compliant - C1.N not ' accessible from within C1(Of T) in all End Sub ' languages Protected Sub M2(n As C1(Of T).N) ' CLS-compliant – C1(Of T).N accessible End Sub ' inside C1(Of T) End Class Public Class C2 : Inherits C1(Of Long) Protected Sub M3(n As C1(Of Integer).N) ' Not CLS-compliant – C1(Of Integer).N is not End Sub ' accessible in C2 (extends C1(Of Long)) Protected Sub M4(n As C1(Of Long).N) End Sub End Class ' Attempting to compile the example displays output like the following: ' error BC30508: 'n' cannot expose type 'C1(Of Integer).N' in namespace ' '' through class 'C1'. ' ' Protected Sub M1(n As C1(Of Integer).N) ' Not CLS-compliant - C1.N not ' ~~~~~~~~~~~~~~~~ ' error BC30389: 'C1(Of T).N' is not accessible in this context because ' it is 'Protected'. ' ' Protected Sub M3(n As C1(Of Integer).N) ' Not CLS-compliant - C1(Of Integer).N is not ' ' ~~~~~~~~~~~~~~~~ ' ' error BC30389: 'C1(Of T).N' is not accessible in this context because it is 'Protected'. ' ' Protected Sub M4(n As C1(Of Long).N) ' ~~~~~~~~~~~~~ ' Module Example Public Sub Main() End Sub End Module