www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4544] New: Better error-message when expecting string but got a character constant

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4544

           Summary: Better error-message when expecting string but got a
                    character constant
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-08-01
07:01:28 PDT ---
In this example single quotes were used instead of double quotes by accident:

import std.stdio;

void main() {
    writeln('test');
}

This spits out way too many error lines:

test.d(5): unterminated character constant
test.d(5): found 'est' when expecting ','
test.d(5): unterminated character constant
test.d(5): found ';' when expecting ','
test.d(6): expression expected, not '}'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'
test.d(7): found 'EOF' when expecting ','
test.d(7): expression expected, not 'EOF'

I'm hoping for a simpler error message than all of this. :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 01 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4544



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-08-01
10:49:25 PDT ---
I'm sorry, I meant "literal", not constant.

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