C#C
C#4y ago
LukeJ

❔ Inconsistent accessibility [Answered]

I have this bit of code here
enum UnitName {
    Warrior,
    Archer,
    Cleric
}

public readonly record struct Unit(char indicator, int cost, int damage, int hp, int range);

public static class Units {
    public static readonly Map<UnitName, Unit> all = Map(
        (UnitName.Warrior, new Unit('x', 15, 4, 9, 1)),
        (UnitName.Archer, new Unit('x', 20, 2, 5, 4)),
        (UnitName.Cleric, new Unit('x', 30, 1, 3, 6))
    );
}


And I cannot for the life of me figure out why it gives me the error Inconsistent accessibility: field type 'Map<UnitName, Unit>' is less accessible than field 'Units.all. Map is just an immutable dictionary from Language.Ext (https://louthy.github.io/language-ext/LanguageExt.Core/Immutable%20Collections/Map/index.html) Any ideas?
Was this page helpful?