www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14270] New: final interface: attribute is ignored

https://issues.dlang.org/show_bug.cgi?id=14270

          Issue ID: 14270
           Summary: final interface: attribute is ignored
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: rswhite4 gmail.com

This code works:
----
final interface Foo { }

class Bar : Foo { }
----

But it shouldn't. It seems that the final attribute is ignored.

So we have two choices:
#1: Disallow the final attribute for interfaces
#2: Recognize it correctly

Since this code works (to emulate C++ namespaces, I think):
---
final abstract class Quatz { }
----

and this is disallowed:
----
class Test : Quatz { }
----

We should go with #2

--
Mar 10 2015