[Issue 9862] New: dchar concat "string literal" is not allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 2 09:54:53 PDT 2013


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

           Summary: dchar concat "string literal" is not allowed
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-04-02 09:54:52 PDT ---
void main() {
    dchar c = 'A';
    dstring s0 = "bcd";  // OK
    auto s1 = c ~ s0;    // OK
    auto s2 = c ~ "bcd"; // Error, bad.
    string s3 = "bcd";
    auto s4 = c ~ s3; // Error, good.
}


dmd 2.063alpha gives:

temp.d(5): Error: incompatible types for ((c) ~ ("bcd")): 'dchar' and 'string'
temp.d(7): Error: incompatible types for ((c) ~ (s3)): 'dchar' and 'string'


The line of s4 is an expected error. But I think the error with s2 should not
happen.

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