[Issue 8684] Missing ')' in argument list creates a sea of error messages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 12 14:31:41 PDT 2012


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2012-10-12 14:31:38 PDT ---
Some cases that look related (but I don't know if they are actually similar).

>From the thread:
http://forum.dlang.org/thread/osnevnwnshreoaudleep@forum.dlang.org

In the following examples I'd like the D compiler to give more focused error
messages.

----------------------

int main() {
     for (int i = 0, i < 10, i++) {
         // do something
     }
     return 0;
}


temp.d(2): Error: semicolon expected, not '<'
temp.d(2): Error: expression expected, not '<'
temp.d(2): Error: found '10' when expecting ';' following for condition
temp.d(2): Error: expression expected, not ','
temp.d(2): Error: found 'i' when expecting ')'
temp.d(2): Error: expression expected, not ')'
temp.d(2): Error: found '{' when expecting ';' following statement
temp.d(5): Error: Declaration expected, not 'return'
temp.d(6): Error: unrecognized declaration

----------------------

void main() {
     foreach (i, 0 .. 10) {}
}


temp.d(2): Error: basic type expected, not 0
temp.d(2): Error: no identifier for declarator int
temp.d(2): Error: found '0' when expecting ';'
temp.d(2): Error: expression expected, not '..'
temp.d(2): Error: found '10' when expecting ')'
temp.d(2): Error: found ')' instead of statement
temp.d(3): Error: unrecognized declaration

---------------------------------

void main() {
     int[10] data;
     foreach (i, x, data) {}
}



temp.d(3): Error: no identifier for declarator data
temp.d(3): Error: found ')' when expecting ';'
temp.d(4): Error: found '}' when expecting ')'
temp.d(4): Error: found 'EOF' instead of statement
temp.d(4): Error: found 'EOF' when expecting '}' following compound statement

---------------------------------

void main() {
     int[10] data;
     foreach (i; x; data) {}
}


temp.d(3): Error: found ';' when expecting ')'
temp.d(3): Error: found ')' when expecting ';' following statement

---------------------------------

-- 
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