I came across this post earlier today; Abhinaba nails something I’ve suspected all along…the CIL supports method overloading by return type alone. Maybe I’m clueless, but why doesn’t C# or VB implement this part of the CIL? So many times in the past I’ve wanted to do just this, it just feels natural and I’ve always wondered why the compiler yelled at me for attempting it. So, I’ve always ended up either having disparate method names that essentially return the same functionality (albeit a different type), or I’ve left it up to calling code to sort it all out (for example, breaking a string down into a char array…sounds trivial, but it breaks the whole black box paradigm of OOP IMO).
Can anyone explain to me why this would be a bad thing to include in a language?



No comments yet