C
C#2y ago
Гокси

Failing upcast

Hello, for some reason im getting this error while my class Jelo is being declared as
public class Jelo : Namernica, IManaged
public class Jelo : Namernica, IManaged
Also if i try to explicitly cast, my app just breaks during runtime
1 Reply
Гокси
ГоксиOP2y ago
also if i map it with .Select(it => it as IManaged), it works, why isn't it able to directly cast ? https://ericlippert.com/2007/10/16/covariance-and-contravariance-in-c-part-1/
Want results from more Discord servers?
Add your server