[Issue 2910] New: ~= can append array literals to strings.

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2910

   Summary: ~= can append array literals to strings.
   Product: D
   Version: 2.029
  Platform: PC
OS/Version: Windows
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: clugd...@yahoo.com.au


void main()
{
   char [] s;
   s ~= [0x313233L, 0x44];
}

D2 only, D1 correctly rejects it.


-- 



[Issue 2910] ~= can append array literals to strings.

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2910





--- Comment #1 from dsim...@yahoo.com  2009-04-29 09:53 ---
I'm not sure I fully understand this bug, but if I do understand it correctly,
it's a dup of bug 2892.  Please see whether this is the case.


-- 



[Issue 2892] Appending U[] to T[] where U : T but U != T yields corrupted results

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2892


clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au




--- Comment #1 from clugd...@yahoo.com.au  2009-04-29 10:31 ---
*** Bug 2910 has been marked as a duplicate of this bug. ***


-- 



[Issue 2910] ~= can append array literals to strings.

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2910


clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE




--- Comment #2 from clugd...@yahoo.com.au  2009-04-29 10:31 ---
(In reply to comment #1)
 I'm not sure I fully understand this bug, but if I do understand it correctly,
 it's a dup of bug 2892.  Please see whether this is the case.

Yup, it's the same. Although I think it only applies when the literal is an
integral array literal.



*** This bug has been marked as a duplicate of 2892 ***


-- 



[Issue 2900] Array appending slowed drastically since integration of druntime

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2900


s...@invisibleduck.org changed:

   What|Removed |Added

 AssignedTo|bugzi...@digitalmars.com|s...@invisibleduck.org
 Status|ASSIGNED|NEW




-- 



[Issue 2900] Array appending slowed drastically since integration of druntime

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2900


s...@invisibleduck.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED




--- Comment #3 from s...@invisibleduck.org  2009-04-29 11:42 ---
Thanks for doing this research.  The reason gc_query() is currently used is
because it provides a means of determining explicitly whether the array is an
interior slice.  However, I've begun thinking that it would make more sense
just to require that gc_sizeOf() always return zero for interior pointers (I'd
left the door open for it to return a positive value).  That would bring
performance in line with Phobos pre-Druntime.  Either way though, the caching
of BlkInfo is a valuable change.  I'll see about at least getting these patches
applied before the next release.


-- 



[Issue 2714] std.getopt erroneously splits arguments

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2714


and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




-- 



[Issue 2906] writef problem with formatting floating point

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2906


and...@metalanguage.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED




--- Comment #3 from and...@metalanguage.com  2009-04-29 14:35 ---
Added unittest.


-- 



[Issue 2912] New: Incorrect array append for mixed character sizes

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2912

   Summary: Incorrect array append for mixed character sizes
   Product: D
   Version: unspecified
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: and...@metalanguage.com


void main() {
char[] a;
wstring b = abcw;
a ~= b;
writeln(a.length);
}

The program prints 6. It should print 3.


-- 



[Issue 2892] Appending U[] to T[] where U : T but U != T yields corrupted results

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2892


dsim...@yahoo.com changed:

   What|Removed |Added

 CC||and...@metalanguage.com




--- Comment #2 from dsim...@yahoo.com  2009-04-29 15:19 ---
*** Bug 2912 has been marked as a duplicate of this bug. ***


-- 



[Issue 2892] Appending U[] to T[] where U : T but U != T yields corrupted results

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2892





--- Comment #3 from dsim...@yahoo.com  2009-04-29 15:26 ---
Also, this doesn't happen only for array literals.  Here, I .dup the literals
to make sure they're allocated like normal arrays and it still happens.

import std.stdio;

void main() {
uint[] foo = [1U,2,3,4,5].dup;
ubyte[] bar = [cast(ubyte) 1,2,3,4].dup;
foo ~= bar;
writeln(foo);  // 1 2 3 4 5 67305985
foo.length = 5;
ulong[] baz = [1UL,2,3,4].dup;
foo ~= baz;
writeln(foo);  // 1 2 3 4 5 1 0 2 0 3 0 4 0
}


-- 



[Issue 2913] New: aliasing a ref type is not possible

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2913

   Summary: aliasing a ref type is not possible
   Product: D
   Version: unspecified
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: and...@metalanguage.com


alias ref int rint;

rint foo() { static int x; return x; }

void main()
{
auto p = (foo());
}

This doesn't work. It led me to write the ugliest code I have ever written.
Search std.range for mixin if you want to see ugly stuff.


-- 



[Issue 2914] New: to!string(struct) is broken

2009-04-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2914

   Summary: to!string(struct) is broken
   Product: D
   Version: 2.029
  Platform: PC
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: bugzi...@digitalmars.com
ReportedBy: jason.james.ho...@gmail.com


to's if condition uses is(T.init.toString) instead of
is(typeof(T.init.toString)). This makes to act as if the structs never include
a toString method


--