c# - internal interface *less* accessible than an internal protected constructor? -


i have interface , abstract base class defined in same assembly:

ifoo.cs:

internal interface ifoo { ... } 

base.cs:

public abstract class base {     internal protected base(ifoo foo) { ... } } 

this generates following compiler error:

cs0051: inconsistent accessibility: parameter type 'ifoo' less         accessible method 'base.base(ifoo)' 

if make base class constructor internal-only, error goes away. since class abstract, maybe adding protected accessibility doesn't accomplish anything...

still, don't understand error. msdn defines 'protected internal'

"access limited current assembly or types derived containing class"

how internal interface ifoo less accessible internal protected constructor?

this msdn page defined 'protected internal' (emphasis original):

the protected internal accessibility level means protected or internal, not protected , internal. in other words, protected internal member can accessed class in same assembly, including derived classes. limit accessibility derived classes in same assembly, declare class internal, , declare members protected.

so in other words, types outside current assembly derive base have access base(ifoo foo) wouldn't have access ifoo, since internal. error.


Comments

Popular posts from this blog

HTTP/1.0 407 Proxy Authentication Required PHP -

curl - PHP fsockopen help required -

c# - Resource not found error -