
28 May
2013
28 May
'13
2:47 p.m.
Mateusz Kowalczyk
Yes, it is in fact busy work and yes, it could probably be done for you by the compiler. I imagine the reason it isn't is simply because forcing heterogeneous collections where only homogeneous ones were intended is usually a sign of the fact that you are doing it wrong and usually there's a better solution. Putting in direct support for it in the compiler would just make the compiler more complex and effectively encourage bad programming. It's just not something that comes up often enough to warrant a compiler extension.
Several people have implied that wanting to do this suggests that I'm doing something wrong. I can't find the code where I did this, but is there a general anti-pattern here?