❔ A question about struct - interface implementation
Structs that implement interfaces arent allocated on the heap normally, rather just if being cast to the specific interface?
I'm posting this because im not 100% sure about it
4 Replies
Structs with interface are allocated the same way as regular structs. It's only when referencing them through the interface they are boxed and treated like objects
Yeah thats what I thought, thanks
That also means added limitations such as not being able to use structs in generic covariance
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.