[Issue 8312] New: Too many error messages with a writeln of fixed size array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 27 09:36:47 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8312

           Summary: Too many error messages with a writeln of fixed size
                    array
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-06-27 09:39:16 PDT ---
This is wrong D2 code (because currently D doesn't have variable length arrays,
and n is a run-time value):


import std.stdio;
void main() {
    uint n = 1;
    uint[n + 1] foo;
    writeln(foo);
}


I think it prints too many error messages (DMD 2.060alpha):

test.d(4): Error: variable n cannot be read at compile time
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: variable n cannot be read at compile time
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: variable n cannot be read at compile time
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: variable n cannot be read at compile time
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: variable n cannot be read at compile time
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u
test.d(4): Error: Integer constant expression expected instead of n + 1u

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list