www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15931] New: The compiler lets you try to derive from a const,

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

          Issue ID: 15931
           Summary: The compiler lets you try to derive from a const,
                    immutable, or inout, shared class
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: issues.dlang jmdavisProg.com

This code compiles withut error:


class C
{
}

class D : const(C)
{
}

void main()
{
}

I assume that this is just another case of the compiler ignoring an attribute
when it doesn't apply, but in this case, it's pointless and potentially
confusing. immutable, inout, and shared are also all currently allowed by the
compiler.

--
Apr 15 2016