Please vote for https://quality.embarcadero.com/browse/RSP-10217 (Add ability to ctrl-click on 'inherited', the way you can for identifiers)

Please vote for https://quality.embarcadero.com/browse/RSP-10217 (Add ability to ctrl-click on 'inherited', the way you can for identifiers)

P.S. Before anyone tells me that you can do that when you explicitly write the method name - let me tell you this is bad because then you have potential bugs waiting whenever you change the signature and don't change any inherited call as well.

Comments

  1. Aaaanndd if you write "inherited Foo();" instead of "inherited;" you could get an EAbstractError if the inherited calls a abstract method. Without the explizit method name you are safe.
    Example code from my XE: http://pastebin.com/5LfWzDEX

    ReplyDelete
  2. No, this is a very bad idea!  It would encourage people to make greater use of naked inherited.  Naked inherited is evil, leading to hard-to-find bugs in your codebase, because if there's nothing to call, it will simply skip the call entirely, even if that's not what you intended.  (The original TObjectDictionary is a fairly well-known example of this.)

    Fabian S. Biehn That could be easily fixed by actually fixing it, by making an inherited Foo() call to an abstract method a compile-time error.  Encouraging people who can't keep their inheritance hierarchy straight to compensate for it by using dangerous, bug-prone features does not improve the situation for anyone.

    ReplyDelete

Post a Comment