Summary: final override inconsistent when implementing interfaces
           Product: D
           Version: 1.038
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid, spec
          Severity: normal
          Priority: P2
         Component: DMD

The following code builds:

interface I
  void foo();

class C : I
  override void foo();

But the following does not work:

class C : I
  final override void foo();

testfinaloverride.d(8): function does not override any

The two cases should be consistent.  The spec is unclear to me as to whether
implementing an interface function qualifies as overriding a function or not.

I would vote for the case where override requires either to override a base
class function or implement an interface function, since it is a pain if you
change a base class to an interface, you'd have to remove all the override
keywords.  So I'm marking it as rejects-valid.

The spec should also specifically lay out what override does in the case of


Reply via email to