https://issues.dlang.org/show_bug.cgi?id=17623

          Issue ID: 17623
           Summary: Unexpected failure of an assertion on empty strings
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

According to the documentation [1]:

   "For static and dynamic arrays, identity is defined as referring to
    the same array elements and the same number of elements."

this code

   $ cat stringidentity.d 
   void main ()
   {
      string s = null;
      string t = "";
      assert (s is t);
   }

shall pass but the assertion fails

   $ ./stringidentity
   [email protected](5): Assertion failure

[1] https://dlang.org/spec/expression.html#identity_expressions

--

Reply via email to