On Mon, 04 May 2009 12:09:09 -0400, Georg Wrede wrote:
If I remember correctly, string literals are stored with a null
appended, so as to make them easier to use with OS calls, etc. Could it
be that "" stores a 1-byte string, consisting with just this null? Then
this behavior would be unde
e:
char[] s;
assert(s is null);
assert(s.dup is null);
assert("" !is null); // OK
assert("".dup !is null); // FAILED
At least the last two lines behave not consistent.
Either both are failed, or both are passed.
OK, your original post was this:
assert( s
is null);
assert(s.dup is null);
assert("" !is null); // OK
assert("".dup !is null); // FAILED
At least the last two lines behave not consistent.
Either both are failed, or both are passed.
OK, your original post was this:
assert( s.dup is null); // OK
asse
Steven Schveighoffer wrote:
> On Mon, 04 May 2009 09:46:57 -0400, Qian Xu
> wrote:
>
>> Hi All,
>>
>> The following code will throw an exception:
>> char[] s;
>> assert( s.dup is null); // OK
>> assert("".dup !is null); // FAILED
&g
rt(s.dup is null);
assert("" !is null); // OK
assert("".dup !is null); // FAILED
At least the last two lines behave not consistent.
Either both are failed, or both are passed.
On Mon, 04 May 2009 09:46:57 -0400, Qian Xu
wrote:
Hi All,
The following code will throw an exception:
char[] s;
assert( s.dup is null); // OK
assert("".dup !is null); // FAILED
"".dup is expectly also an empty string.
Is this a compiler bug?
I think you might
Hi All,
The following code will throw an exception:
char[] s;
assert( s.dup is null); // OK
assert("".dup !is null); // FAILED
"".dup is expectly also an empty string.
Is this a compiler bug?
--Qian