So, we have a public interface, something like:
Public Interface PublicInterface
Sub DoStuff()
End Interface
And a class with internal visibility implementing the public interface:
Friend Class InternalClass
Implements PublicInterface
Friend Sub DoStuff() Implements PublicInterface.DoStuff
'Why is this allowed? This is accessible to "public" clients!
End Sub
End Class
I guess I'm confused because the whole point of an interface is to be able to interface with it... something like this:
Public Class AClassInAssembly
Public Shared Function GetPublicInterface() As PublicInterface
Return New InternalClass()
End Function
End Sub
So you can call it like this:
Public Class AClassOutsideAssembly
Sub Main()
AClassInAssembly.GetPublicInterface().DoStuff()
End Sub
End Class
TLDR version: why can you change the access modifier on an interface's method? I don't want anyone to think that they're all of a sudden restricting access to that method that IS essentially public regardless of whether or not the class is.
Can you change a setting to not allow this?