[Issue 6811] New: Confusion between string* and immutable(char)*, related to AA's

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 13 09:44:53 PDT 2011


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

           Summary: Confusion between string* and immutable(char)*,
                    related to AA's
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2011-10-13 09:43:59 PDT ---
void doExclude(string exclude) {
    string[string] aa;

    int[] keep;
    foreach(int i, h; ["a", "b"]) {
        auto ptr = h in aa;
        pragma(msg, typeof(ptr));  // string*
        pragma(msg, typeof(*ptr)); // string
        if(*h != exclude) keep ~= i;
    }
}

test.d(9): Error: incompatible types for ((*cast(immutable(char)*)h) !=
(exclude)): 'immutable(char)' and 'string'

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