www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9862] New: dchar concat "string literal" is not allowed

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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs 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: -------
Apr 02 2013