> The following code:
>
[quoted text clipped - 21 lines]
> Point2D and therefore the two List<T> types are equivalent as far as
> Point2D?
They're not equivalent at all.
Consider what happens when you try to add a Point2D to each of them:
with a List<Point2D> it's fine. With a List<SubPoint2D> it should go
bang.
Basically generics in C# don't support covariance. It's a pain, but it
also gives more safety. It's likely that C# 4 will have more support
for this, at the interface and delegate level, but that's all.
What you *can* do is make ProcessPoints a generic method:
void ProcessPoints(List<T> pts) where T : Point2D
That may help you, depending on what you need to do in ProcessPoints.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
jonpb - 28 Mar 2008 17:06 GMT
>> The following code:
>>
[quoted text clipped - 37 lines]
>
> That may help you, depending on what you need to do in ProcessPoints.
Thanks very much Jon. The generic method works in this particular case,
as all it does is draw the shape there is no manipulation of the lists
or changing of values, but your point is well taken.