
12 Aug
2009
12 Aug
'09
11:16 p.m.
Scott McMurray wrote:
And when they do build infrastruture, there are holes. (Try to write the downcast you need in "void Foo<T>(T x) where T : IFoo;" so that you can pass x to "void Bar<U>(U x) where T : IFoo, IBar;", for example.)
Disallowing downcasting, which is inherently unsafe, sounds more like a design decision than a hole in the system. Use overloading instead to visit the possible values. (just a wild guess, I know nothing of C# generics)