www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13520] New: Redundant static variable cannot be read error

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

          Issue ID: 13520
           Summary: Redundant static variable cannot be read error
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

int n = 2;
void main() {
    int[n][2][2][2] a;
}


dmd 2.067alpha gives:

test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time
test.d(3,21): Error: static variable n cannot be read at compile time

--
Sep 23 2014