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

           Summary: Appending a string to a dstring is allowed
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: ja...@aatch.net


--- Comment #0 from James Miller <ja...@aatch.net> 2012-04-19 03:45:23 PDT ---
Appending a regular `string` to a `dstring` does not cause a compile time
error.

This case:

  string a = "abc";
  dstring b = "abc"d;

  b ~= a;

Causes a runtime error: array cast misalignment.

This case:

  string a = "abcd";
  dstring b = "abcd"d;

  b ~= a;
  writeln(b);

causes a segmentation fault. Given that

  string a = "abcd";
  dstring b = "abcd"d;

  a ~= b;

causes a compile time error, and many other operations do not allow implicit
string -> dstring casting, it should be picked up as a type error.

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

Reply via email to