© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
3 replies
NamaimNM

Casting class with generic variable to the same class with an interface that the generic implements

i have a variable of type ScriptableUnit<MinionStats> and im trying to cast it to ScriptableUnit<IUnitStats> and it does not work even though MinionStats implements the IUnitStats interface, do you know why and how i can deal with it?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Create dynamic class that implements interface with static properties
C#CC# / help
3y ago
❔ Check What Generic Type a Class Implements
C#CC# / help
4y ago
❔ does an interface go inside a generic parent class?
C#CC# / help
4y ago
help with generic interface
C#CC# / help
2y ago