News for hackers. Stuff that matters.
Re:How generics were added to .NET by yarg on Monday March 05, 2018 @07:26PM (#16525875)
Looking at the head of a List does not work. The class of that element is within the scope of <? extends ListType>, an is not necessarily not ListType.
Re:How generics were added to .NET by Groxx on Tuesday March 06, 2018 @01:06AM (#16527192)
To spell this out so it's a bit more obvious, given a Thing at head of a list, you could have:

    - a List<Thing>
    - a List<ThingSuperclass>
    - a List<? extends Thing>
    - a List<? super ThingSubclass>
    - a List<IThing>
    - a List<ILiterallyAnyImplementedIFace>
    - a List<IHaventForgottenInterfacesCanExtendOthers>
    - a List<Object>
    - a List<I'm probably forgetting some possibilities>
And you have no way of knowing which it is.

So yes, it's a boundary, which is significantly more than nothing. But far less useful than it feels like at first.

Re:How generics were added to .NET by yarg on Monday March 05, 2018 @09:50PM (#16526511)
*and is not necessarily ListType.

Idiot.

Re:How generics were added to .NET by Twisol on Tuesday March 06, 2018 @12:24AM (#16527052)
For the downvoters, the author is correcting themselves after the edit window. It's clearly self-deprecating humor, not a personal attack.
Re:How generics were added to .NET by rusanu on Tuesday March 06, 2018 @03:29AM (#16527644)
Not to mention that an empty list still has a type...