Tech Off Post

Single Post Permalink

View Thread: Generi type inheritance ????
  • User profile image

    So what's your objection realy ???

    the fact that the compiler doest't isues a warning for my class, it can just as easily isue a warning if it gets implemented ...

    the code works even it's just a warning , something to be aware of. and if you instantiate a
    Snapshot<SnapshotBase>  sn = new Snapshot<SnapshotBase>() you should be fully aware of the fact that you're using the instantiated' class methods primarely or if you want to use the base class' methods you can cast. Or maybe there's anothe way around this to be sure all of the time what method you are calling.

    Maybe generic clases that extend other types should't even be allowed to have non virtual or non explicit interface methos. The best way can found to solve this.

    But I don't see why generics cand be brought to the next level by parametrising more of their elements.

    Generics started a new programing paradigm parametrisable code. And it should keep evolving and not stop right here.

    I' dont see any benefits from stoping.