C
C#2y ago
bandz

less accessible??

Can someone explain what this error means?
5 Replies
Thinker
Thinker2y 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
bandz
bandz2y ago
Oh so internal makes it less accessible?
Thinker
Thinker2y ago
yep
Becquerel
Becquerel2y ago
internal means 'can only be seen within the current assembly' where assembly roughly equates to projects
bandz
bandz2y ago
Ohh thanks for teaching me.