Closed GeorgeS2019 closed 4 months ago
By using Dictionary element as string instead of proper type like Enum
// Define types
public enum Person { Alice, Bob }
public enum Location { HomeA, HomeB, Park, Station }
public enum Taxi { Taxi1, Taxi2 }
We are faced with mixing enum types e.g. Person and Taxi of different real world objects within one Dictionary as Key!
// Define initial state
private Dictionary<object, Location> loc = new Dictionary<object, Location>
{
[Person.Alice] = Location.HomeA,
[Person.Bob] = Location.HomeB,
[Taxi.Taxi1] = Location.Park,
[Taxi.Taxi2] = Location.Station
};
Describe the proposed feature and how it helps to overcome a problem or limitation
Open Github Discussion
Other information about your context or usecase.
No response
If known, describe how your proposal will work, with code, pseudo-code, mock-ups, or diagrams
No response
Anything else
No response