Coffeehouse Post

Single Post Permalink

View Thread: Why does C# not support this?
  • User profile image
    Maddus Mattus

    Minh said:
    Maddus Mattus said:



    But there's a legit reason to do BaseClass b = DoWork();


    It's not that what you propose isn't technically possible by the compiler, it just breaks OOP. You don't want the compiler to break OOP do you?

    To make an omelet, you have to break some eggs


    You could do something like

    default A doWork()

    B doWork()

    C doWork()

    D doWork()


    would be cool!


    Go do some work Smiley