C
C#3y ago
bandzz

less accessible??

Can someone explain what this error means?
5 Replies
Thinker
Thinker3y ago
You have something like this
internal enum Direction
{
// ...
}
internal enum Direction
{
// ...
}
public class GameState
{
public Direction Dir { get; }
}
public class GameState
{
public Direction Dir { get; }
}
This is invalid because Direction has a lower accessibility (internal) than Direction (public) The order of accessibility is private < protected < internal < public You can't have public properties have a greater accessibility than its type
bandzz
bandzzOP3y ago
Oh so internal makes it less accessible?
Thinker
Thinker3y ago
yep
becquerel
becquerel3y ago
internal means 'can only be seen within the current assembly' where assembly roughly equates to projects
bandzz
bandzzOP3y ago
Ohh thanks for teaching me.

Did you find this page helpful?