❔ Why hasn't my class implemented the interface?
Given that
List<int>
is a subtype of IEnumerable<int>
I don't see what the issue is here.10 Replies
That's not how interface implementation works
I mean, your link wasn't bad diddy
There is a difference between overriding (that feature) and implementing (from an interface)
What does this mean
Diddy posted a link, then deleted it
oh I see
Basically my question is why isn't
public List<int> Get()
an implementation of public IEnumerable<int> Get();
when List is a subtype of IEnumerableBecause that's not how implementations work
It's the same type or nothing
Ok
what is the reason for that
To avoid unintentional implementation and ambiguities
Fair enough, I suppose I can still just return a List
Correct
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.