[Issue 12821] Missed redundant storage class / protection errors.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jun 19 20:52:34 PDT 2014


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

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
By recent git-head change, many cases are properly fixed.

final final void foo() { }        // Error, redundant 'final'
final shared final void foo() { } // Error, redundant 'final'
final static final void foo() { } // Error, redundant 'final' <- OK

static static void foo() { } // Error, redundant 'static' <- OK
extern extern void foo() { } // Error, redundant 'extern' <- OK
align align void foo() { }   // Error, redundant 'align' <- OK

shared shared void foo() { }           // Error, redundant 'shared'
shared static shared void foo() { }    // Error, redundant 'shared' <- OK
shared extern shared void foo() { }    // Error, redundant 'shared' <- OK
shared extern(D) shared void foo() { } // Error, redundant 'shared' <- OK
shared align shared void foo() { }     // Error, redundant 'shared' <- OK

const const void foo() { }               // Error, redundant 'const'
protected protected void foo() { }       // Error, redundant 'protection'
const protected const void foo() { }     // Error, redundant 'const' <- OK
protected const protected void foo() { } // Error, redundant 'protection' <- OK

const immutable void foo() { }         // Error, conflicting 
const package immutable void foo() { } // Error, conflicting  <- OK
const static immutable void foo() { }  // Error, conflicting  <- OK


These are still OK cases:

debug debug void foo() { }          // OK
shared debug shared void foo() { }  // OK

Currently it's intended. Because `debug ...` is parsed as
ConditionalDeclaration, so they are equivalent with:

debug { debug { void foo() { } } }
shared { debug { shared { void foo() { } } } }

--


More information about the Digitalmars-d-bugs mailing list