[Issue 9330] Cannot run dmd test suite with MSYS

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9330



--- Comment #2 from github-bugzi...@puremagic.com 2013-01-17 00:34:43 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ab88809d64abb97d1e0387ba199380d67319dfb1
fix Issue 9330 - Cannot run dmd test suite with MSYS

This is a workaroud for the MSYS bug:
http://sourceforge.net/tracker/?func=detailatid=102435aid=1100932group_id=2435

https://github.com/D-Programming-Language/dmd/commit/6873d69990be15071d93475b23e529c248c629ea
Merge pull request #1500 from 9rnsr/fix9330

Issue 9330 - Cannot run dmd test suite with MSYS

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


[Issue 9330] Cannot run dmd test suite with MSYS

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9330


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
   Platform|x86_64  |x86
Version|unspecified |D1  D2
 Resolution||FIXED


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


[Issue 6743] ICE(mars.c) attempting to compile an exe file

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6743



--- Comment #2 from github-bugzi...@puremagic.com 2013-01-17 00:39:21 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5ff13ae3ffb4c46b846c32f77da8d0500bb3c860
Fixes Issue 6743 - Print error if -run is followed by a path with an
extension not matching a source file extension.

https://github.com/D-Programming-Language/dmd/commit/d46425101c15fb3c8adec6e4a2dc2a405b6a0851
Merge pull request #1460 from AndrejMitrovic/Fix6743

Issue 6743 - Print error if -run is followed by a path with an incompatible
extension

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


[Issue 6743] ICE(mars.c) attempting to compile an exe file

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6743



--- Comment #3 from github-bugzi...@puremagic.com 2013-01-17 00:41:42 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/56b6293b7f37f82fa7a4a6ce00fa1e3e79feb788
fix Issue 6743 - ICE(mars.c) attempting to compile an exe file

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


[Issue 5038] Allow declaring class invariant without parentheses

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5038



--- Comment #7 from Don clugd...@yahoo.com.au 2013-01-17 01:28:22 PST ---
(In reply to comment #6)
 (In reply to comment #5)
  The deprecation page lists it as deprecated since 2.057, but the Error and 
  Gone
  dates are empty. I'm not sure what the plan is, but I doubt there's any
  *compilable* D2 code out there that actually uses invariant instead of
  immutable.

I am 100% sure that is true. 'invariant' only meant 'immutable' for a very
short period of time, when hardly anyone was using D2, and when D2 was
completely experimental and not seriously usable.

 
 The general idea is to leave at least six months between deprecation stages. 
 The version numbers are missing because there is no fixed release schedule, 
 and
 no guarantee the change would be pulled in time to match any projected date.


Well, this is a very strange situation. invariant without parentheses is LEGAL
IN D1! When converting D1 code to D2, you get this nonsense deprecation message
asking you to use immutable instead.

We have existing production code which uses invariant without parentheses!
We should make it legal again. This would be an undeprecation, which AFAIK has
never happened before in D.

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


[Issue 9332] New: [REG][2.061 - 02.061a] struct constructor taking itself creates Warning: statement is not reachable

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9332

   Summary: [REG][2.061 - 02.061a] struct constructor taking
itself creates Warning: statement is not reachable
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: monarchdo...@gmail.com


--- Comment #0 from monarchdo...@gmail.com 2013-01-17 08:04:46 PST ---
Most probably *just* introduced: the packaged 2.061 doesn't create this, but
the latest githead produces the bug.

Produced with dmd with both debug and release. win32 on a win7_64.

//
Program:
//
struct S
{
this(S) // - Line 3 here
{
assert(0, unreachable?);
}
}

void main()
{
S a;
S b = S(a);
}
//

//
Compiler switch:
//
rdmd -wi -O main.d
//

//
Compiler output
//
main.d(3): Warning: statement is not reachable
//

The irony here is that running the program gives:
//
core.exception.AssertError@main.d(5): unreachable?
//

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


[Issue 9333] New: druntime module is not compiled into binary

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9333

   Summary: druntime module is not compiled into binary
   Product: D
   Version: D2
  Platform: All
OS/Version: Linux
Status: NEW
  Severity: critical
  Priority: P2
 Component: druntime
AssignedTo: nob...@puremagic.com
ReportedBy: ma...@maxim-fomin.ru


--- Comment #0 from Maxim Fomin ma...@maxim-fomin.ru 2013-01-17 08:13:55 PST 
---
Two month ago etc.linux.memoryerror module was added into druntime
(https://github.com/D-Programming-Language/druntime/blob/master/src/etc/linux/memoryerror.d)
for converting linux segfaults into exceptions.

However, it seems to be absent:

import etc.linux.memoryerror;
import core.stdc.stdio : printf;


class A { int x; }

void main()
{
A a;
try
{
a.x = 0;
}
catch(NullPointerError er)
{
printf(catched\n);
}
}
--
main.o:(.data+0xd0): undefined reference to 
`_D3etc5linux11memoryerror16NullPointerError7__ClassZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1


As suggested in this
thread(http://forum.dlang.org/thread/mailman.493.1358378360.22503.digitalmar...@puremagic.com?page=1)
the module may not reach libdruntime/libphobos.a

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


[Issue 9334] New: Dtor and postblit for struct heap object are not always called

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9334

   Summary: Dtor and postblit for struct heap object are not
always called
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ma...@maxim-fomin.ru


--- Comment #0 from Maxim Fomin ma...@maxim-fomin.ru 2013-01-17 08:22:18 PST 
---
If struct object allocated on heap is default constructed, dtor is not called.
If one has non-default initializer, dtor (and postblit) is called.

import std.stdio : writefln;

struct S
{
int i;
this(this) { writefln(%X postbit, i); i = 0;}
~this() { writefln(%X dtor, i); }
}

auto foo()
{
S* s = new S(); // add any argument to new to call dtor
}

void main()
{
foo();
}

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


[Issue 9335] New: Dtors are not called for dynamic arrays initialized by literals

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9335

   Summary: Dtors are not called for dynamic arrays initialized by
literals
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ma...@maxim-fomin.ru


--- Comment #0 from Maxim Fomin ma...@maxim-fomin.ru 2013-01-17 08:34:20 PST 
---
Dynamic arrays of structs initialized by array literals go out of scope without
calling destructors. This does not happen with static arrays.

import std.stdio : writefln;

struct S
{
int i;
this(this) { writefln(%X postbit, i); i = 0;}
~this() { writefln(%X dtor, i); }
}

void main()
{
S[] arr = [S()];
}

Issue is maked as dmd issue, because druntime cannot call destructors when AA
array goes out of the scope.

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


[Issue 9334] Dtor and postblit for struct heap object are not always called

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9334


monarchdo...@gmail.com changed:

   What|Removed |Added

 CC||monarchdo...@gmail.com


--- Comment #1 from monarchdo...@gmail.com 2013-01-17 08:35:18 PST ---
(In reply to comment #0)
 If struct object allocated on heap is default constructed, dtor is not called.
 If one has non-default initializer, dtor (and postblit) is called.
 
 import std.stdio : writefln;
 
 struct S
 {
 int i;
 this(this) { writefln(%X postbit, i); i = 0;}
 ~this() { writefln(%X dtor, i); }
 }
 
 auto foo()
 {
 S* s = new S(); // add any argument to new to call dtor
 }
 
 void main()
 {
 foo();
 }

I don't think so: The postblit (and destructor) you are seeing comes (AFAIK)
from moving a stack allocated S() into the heap, *during* the new.

In both case, the object that is on the heap is never destroyed. D makes no
promises that things get destroyed at the end of a run. (again, AFAIK).

Check this out:
//
import std.stdio;

struct S
{
   int i;
   this(this) { writefln(%X postbit, i); i = 0;}
   ~this() { writefln(%X dtor, i); }
}

auto foo()
{
   S* s = new S(5); // add any argument to new to call dtor
   writeln(here);
}

void main()
{
   foo();
}
//
5 postbit
5 dtor
here
//

As you can see, the dtor we are seeing is *NOT* the one that runs at the end of
the program.

From a performance point of view, I can question why there is a postblit and a
dtor call at all, but it isn't wrong. You probably don't see it on default
construction, because the runtime only copies the T.init value (so no postblit
or any of that jazz).

As far as I'm concerned, there is nothing wrong here.

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


[Issue 9335] Dtors are not called for dynamic arrays initialized by literals

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9335


monarchdo...@gmail.com changed:

   What|Removed |Added

 CC||monarchdo...@gmail.com
   See Also||http://d.puremagic.com/issu
   ||es/show_bug.cgi?id=9334


--- Comment #1 from monarchdo...@gmail.com 2013-01-17 08:39:31 PST ---
(In reply to comment #0)
 Dynamic arrays of structs initialized by array literals go out of scope 
 without
 calling destructors. This does not happen with static arrays.
 
 import std.stdio : writefln;
 
 struct S
 {
 int i;
 this(this) { writefln(%X postbit, i); i = 0;}
 ~this() { writefln(%X dtor, i); }
 }
 
 void main()
 {
 S[] arr = [S()];
 }
 
 Issue is maked as dmd issue, because druntime cannot call destructors when AA
 array goes out of the scope.

Same answer as in http://d.puremagic.com/issues/show_bug.cgi?id=9334.

The array is allocated dynamically, and makes no promises it will release at
the end of the scope, or of the program.

I'm not sure what you mean by array literals, but you'll get the same
behavior with:
S[] arr = new S[](5);

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


[Issue 9336] New: Writeln is unable to print address of shared variable

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9336

   Summary: Writeln is unable to print address of shared variable
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: ma...@maxim-fomin.ru


--- Comment #0 from Maxim Fomin ma...@maxim-fomin.ru 2013-01-17 08:42:37 PST 
---
import std.stdio : writeln;

shared int i;

void main()
{
writeln(i);
}

The root error message is 
\std\format.d(2761): Error: cannot implicitly convert expression (val) of type
shared(int)* to const(void*)

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


[Issue 9332] [REG][2.060 - 02.061] struct constructor taking itself creates Warning: statement is not reachable

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9332


monarchdo...@gmail.com changed:

   What|Removed |Added

Summary|[REG][2.061 - 02.061a] |[REG][2.060 - 02.061]
   |struct constructor taking   |struct constructor taking
   |itself creates Warning:|itself creates Warning:
   |statement is not reachable |statement is not reachable


--- Comment #1 from monarchdo...@gmail.com 2013-01-17 08:45:14 PST ---
(In reply to comment #0)
 Most probably *just* introduced: the packaged 2.061 doesn't create this, but
 the latest githead produces the bug.

Sorry, my bad, the problem *does* appear in 2.061, but not in 2.060.

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


[Issue 9337] New: There's no Duration.max

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9337

   Summary: There's no Duration.max
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: and...@erdani.com


--- Comment #0 from Andrei Alexandrescu and...@erdani.com 2013-01-17 09:28:26 
PST ---
There should be a property for the largest representable duration.

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


[Issue 9337] There's no Duration.max

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9337


Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

 AssignedTo|nob...@puremagic.com|jmdavisp...@gmx.com
   Severity|normal  |enhancement


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


[Issue 9334] Dtor and postblit for struct heap object are not always called

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9334



--- Comment #2 from Maxim Fomin ma...@maxim-fomin.ru 2013-01-17 09:47:29 PST 
---
(In reply to comment #1)
 I don't think so: The postblit (and destructor) you are seeing comes (AFAIK)
 from moving a stack allocated S() into the heap, *during* the new.

You misunderstood the point. The problem is not that D's GC does not collect
structs, the problem is within foo.

The code:

/* to reduce phobos bloat and remove postblit*/
import core.stdc.stdio : printf;

struct S
{
int i;
~this() { printf(%X dtor\n, i); }
}

auto foo()
{
S* s = new S(); // add any argument to new to call dtor
}

void main()
{
foo();
}

Dump of assembler code for function _D4main3fooFZv:
   0x00418768 +0:push   %rbp
   0x00418769 +1:mov%rsp,%rbp
   0x0041876c +4:movabs $0x6362a0,%rdi
   0x00418776 +14:callq  0x41a09c _d_newitemT
   0x0041877b +19:pop%rbp
   0x0041877c +20:retq   
End of assembler dump.

As you see there is no stack allocation.

Case #2 add non-default parameter (1)

Dump of assembler code for function _D4main3fooFZv:
   0x00418768 +0:push   %rbp
   0x00418769 +1:mov%rsp,%rbp
   0x0041876c +4:sub$0x10,%rsp
   0x00418770 +8:movabs $0x6362a0,%rdi
   0x0041877a +18:callq  0x41a0c4 _d_newitemT
   0x0041877f +23:movl   $0x1,-0x8(%rbp)
   0x00418786 +30:lea-0x8(%rbp),%rsi
   0x0041878a +34:mov%rax,%rdi
   0x0041878d +37:movsb  %ds:(%rsi),%es:(%rdi)
   0x0041878e +38:movsb  %ds:(%rsi),%es:(%rdi)
   0x0041878f +39:movsb  %ds:(%rsi),%es:(%rdi)
   0x00418790 +40:movsb  %ds:(%rsi),%es:(%rdi)
   0x00418791 +41:callq  0x418798 _D4main3fooFZv+48
   0x00418796 +46:jmp0x4187a2 _D4main3fooFZv+58
   0x00418798 +48:lea-0x8(%rbp),%rdi
   0x0041879c +52:callq  0x4186f0 _D4main1S6__dtorMFZv
   0x004187a1 +57:retq   
   0x004187a2 +58:leaveq 
   0x004187a3 +59:retq   
End of assembler dump.

Now there is S(1) (struct, not pointer - why?) which is written over memory
allocated by new and dtor is called for this stack struct. Note, even if you
pass 0 (which useless because i is zero anyway), dmd still emits dummy code
like above except that there is 0 instead of 1.

However, it need not to create a temporary S(1), just write 1 directly to value
returned from new, or in other words the expected code in case #2 is:

Dump of assembler code for function _D4main3fooFZv:
   0x00418768 +0:push   %rbp
   0x00418769 +1:mov%rsp,%rbp
   0x0041876c +4:movabs $0x6362a0,%rdi
   0x00418776 +14:callq  0x41a09c _d_newitemT
   change allocated value:movl   $0x1, (%eax)
   0x0041877b +19:pop%rbp
   0x0041877c +20:retq   
End of assembler dump.

Note, this is not about optimizing, because 

auto foo()
{
S* s = new S(1); 
}

have no reason to create a temporary struct and than call destructor on it.

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


[Issue 9335] Dtors are not called for dynamic arrays initialized by literals

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9335



--- Comment #2 from Maxim Fomin ma...@maxim-fomin.ru 2013-01-17 10:07:54 PST 
---
(In reply to comment #1)
 Same answer as in http://d.puremagic.com/issues/show_bug.cgi?id=9334.
 
 The array is allocated dynamically, and makes no promises it will release at
 the end of the scope, or of the program.
 
 I'm not sure what you mean by array literals, but you'll get the same
 behavior with:
 S[] arr = new S[](5);

Well, situation here is different than in issue 9334

import core.stdc.stdio : printf;

struct S
{
int i;
this(this) { printf(%X postbit\n, i); i = 0;}
~this() { printf(%X dtor\n, i); }
}

void main()
{
S[] arr = [S()];
}

Dump of assembler code for function _Dmain:
   0x00418894 +0:push   %rbp
   0x00418895 +1:mov%rsp,%rbp
   0x00418898 +4:sub$0x10,%rsp
   0x0041889c +8:movabs $0x1,%rsi
   0x004188a6 +18:movabs $0x6362a0,%rdi
   0x004188b0 +28:callq  0x41a610 _d_arrayliteralTX
   0x004188b5 +33:xor%ecx,%ecx
   0x004188b7 +35:mov%ecx,-0x8(%rbp)
   0x004188ba +38:lea-0x8(%rbp),%rsi
   0x004188be +42:mov%rax,%rdi
   0x004188c1 +45:movsb  %ds:(%rsi),%es:(%rdi)
   0x004188c2 +46:movsb  %ds:(%rsi),%es:(%rdi)
   0x004188c3 +47:movsb  %ds:(%rsi),%es:(%rdi)
   0x004188c4 +48:movsb  %ds:(%rsi),%es:(%rdi)
   0x004188c5 +49:mov%rax,%rdx
   0x004188c8 +52:movabs $0x1,%rax
   0x004188d2 +62:mov%rcx,%rax
   0x004188d5 +65:leaveq 
   0x004188d6 +66:retq   
End of assembler dump.

Array literal is allocated by _d_arrayliteralTX, yet is initialized by a stack
temporary S(). Where a dtor call on it? The behavior is in contrast to issue
9334 when a dtor in similar situation is called.

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


[Issue 9338] New: Compiler segfault with template mixin creating compile time array

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9338

   Summary: Compiler segfault with template mixin creating compile
time array
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: szad...@gmail.com


--- Comment #0 from Robik szad...@gmail.com 2013-01-17 11:48:55 PST ---
This code segfaults:


mixin template SomeMixin()
{
void test()
{
enum members = makeArray();
}

string[] makeArray()
{
return [a];
}
}

class Foo
{
mixin SomeMixin;
}


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


[Issue 9339] New: std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339

   Summary: std.random.uniform!Enum should return random enum
member
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: hst...@quickfur.ath.cx


--- Comment #0 from hst...@quickfur.ath.cx 2013-01-17 14:33:56 PST ---
Currently, std.random.uniform does not respect enum bounds:

import std.random;
import std.stdio;

enum Fruit {
Apple = 14,
Orange = 27,
Pear = 36,
Mango = 47
}

void main() {
writefln(%d, Fruit.min);
writefln(%d, Fruit.max);

writeln(uniform!Fruit());
}


Typical output:

14
47
cast(Fruit)-2046817621


It should at the very least respect the enum range defined by the enum's .min
and .max properties (which in this case are 14 and 47, respectively).

Ideally, it should only return one of the four possible values of Fruit, not
anything outside the range of .min and .max, and not anything in between the
four possible values.

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


[Issue 9340] New: Covariant return type conflicts with out contract.

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9340

   Summary: Covariant return type conflicts with out contract.
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: e...@atari8.info


--- Comment #0 from Adrian Matoga e...@atari8.info 2013-01-17 14:55:58 PST ---
The following test case fails to compile with the following error message:
test.d(21): Error: cast(const(BaseBar))__result is not an lvalue
Comment out line (1) or change ConcreteBar to BaseBar in (2) and it compiles.
That means the workaround is to use base type in the overriding method.


import std.stdio;

class BaseBar
{
abstract string bar();
}

class BaseFoo
{
abstract BaseBar createBar()
out(result) { assert(result !is null); } body { assert(false); } // (1)
}

class ConcreteBar : BaseBar
{
override string bar() { return ConcreteBar; }
}

class ConcreteFoo : BaseFoo
{
override ConcreteBar createBar() { return new ConcreteBar(); } // (2)
}

void main()
{
auto foo = new ConcreteFoo();
writeln(foo.createBar().bar());
}

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


[Issue 9341] New: Linker error with array literal populated by compile-time tuple

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9341

   Summary: Linker error with array literal populated by
compile-time tuple
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: hst...@quickfur.ath.cx


--- Comment #0 from hst...@quickfur.ath.cx 2013-01-17 15:49:47 PST ---
Code:

import std.traits;

void main() {
enum E { First = 1, Second = 2, Third = 3 };
auto members = [ EnumMembers!E ];
}

Compiler output:

test.o:(.data._D16TypeInfo_Emain1E6__initZ+0x30): undefined reference to
`_Dmain1E6__initZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1


Changing 'auto' to 'static' makes the linker error go away, for some odd
reason.

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


[Issue 9341] Linker error with array literal populated by compile-time tuple

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9341


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||andrej.mitrov...@gmail.com
 Resolution||DUPLICATE


--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
16:18:07 PST ---
*** This issue has been marked as a duplicate of issue 6057 ***

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


[Issue 6057] Problem with defining enum in function

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6057


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 CC||hst...@quickfur.ath.cx


--- Comment #3 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
16:18:07 PST ---
*** Issue 9341 has been marked as a duplicate of this issue. ***

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #3 from bearophile_h...@eml.cc 2013-01-17 16:47:21 PST ---
(In reply to comment #1)

 auto uniform(T)()
 if (is(T == enum)  isIntegral!T || isSomeChar!T)
 {
 enum arr = [EnumMembers!T];
 return randomSample(arr, 1);
 }


I think this is more efficient:


T uniform(T)()
if (is(T == enum)  isIntegral!T || isSomeChar!T)
{
static immutable T[EnumMembers!T.length] members = [EnumMembers!T];
return members[std.random.uniform(0, members.length)];
}

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #4 from bearophile_h...@eml.cc 2013-01-17 16:48:48 PST ---
(In reply to comment #1)

 enum arr = [EnumMembers!T];

Be very careful with enum arrays. They are very inefficient.

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #5 from hst...@quickfur.ath.cx 2013-01-17 16:52:13 PST ---
(In reply to comment #3)
[...]
 I think this is more efficient:
 
 
 T uniform(T)()
 if (is(T == enum)  isIntegral!T || isSomeChar!T)
 {
 static immutable T[EnumMembers!T.length] members = [EnumMembers!T];
 return members[std.random.uniform(0, members.length)];
 }

You're right, we want the array to be statically initialized.

Does enum arr = [...] cause the code to create the array every time the
function is called?

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


[Issue 9342] New: nested aggregates generate closures, even when they don't escape

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9342

   Summary: nested aggregates generate closures, even when they
don't escape
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: nilsboss...@googlemail.com


--- Comment #0 from Nils nilsboss...@googlemail.com 2013-01-17 16:54:40 PST 
---
This creates a closure over i:
---
void f() {
int i;
struct N {
void makeNested() {++i;}
}
// maybe do something with N
}
---
Would be neat if it didn't.

For example, std.string.sformat suffers from this.

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #2 from hst...@quickfur.ath.cx 2013-01-17 16:40:15 PST ---
Yeah, that will do. Except that the enum arr = [EnumMembers!E]; line may run
into issue 6057. :)

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


[Issue 9343] New: Problem installing dmd-2.061-0.fedora.x86_64.rpm on Fedora 18

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9343

   Summary: Problem installing dmd-2.061-0.fedora.x86_64.rpm on
Fedora 18
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: installer
AssignedTo: nob...@puremagic.com
ReportedBy: pwil3...@bigpond.net.au


--- Comment #0 from Peter Williams pwil3...@bigpond.net.au 2013-01-17 
16:55:51 PST ---
Trying to install dmd-2.061-0.fedora.x86_64.rpm on Fedora 18 fails with the
following error message:

Transaction Check Error:
  file / from install of dmd-2.061-0.x86_64 conflicts with file from package
filesystem-3.1-2.fc18.x86_64
  file /usr/bin from install of dmd-2.061-0.x86_64 conflicts with file from
package filesystem-3.1-2.fc18.x86_64
  file /usr/lib from install of dmd-2.061-0.x86_64 conflicts with file from
package filesystem-3.1-2.fc18.x86_64
  file /usr/lib64 from install of dmd-2.061-0.x86_64 conflicts with file from
package filesystem-3.1-2.fc18.x86_64

I believe this is caused by yum/rpm being more fussy about such things and
should be fixable by a small change to the spec file used to build the rpm.
Basically, don't list directories in %files (only files) unless the directory
is exclusive to your package and will be deliberately empty.

I tried using yum's --tolerant switch but the installation still failed.

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #6 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
17:01:43 PST ---
(In reply to comment #4)
 (In reply to comment #1)
 
  enum arr = [EnumMembers!T];
 
 Be very careful with enum arrays. They are very inefficient.

Well, the compiler is very inefficient, static will do.

 T uniform(T)()
 if (is(T == enum)  isIntegral!T || isSomeChar!T)
 {
 static immutable T[EnumMembers!T.length] members = [EnumMembers!T];
 return members[std.random.uniform(0, members.length)];
 }

That's not doing what was requested.

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #7 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
17:08:20 PST ---
As much as I'd love to make a pull for this I already know I'm going to run
into Issue 6057 (which has a pull but needs a review).

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


[Issue 6319] debug's relaxed purity does not apply to nested scopes

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6319



--- Comment #6 from github-bugzi...@puremagic.com 2013-01-17 17:23:07 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fc45fef72942938f2f386bb8daeab327eb7243de
Fix Issue 6319 - debug's relaxed purity does not apply to nested scopes

https://github.com/D-Programming-Language/dmd/commit/66e53d9161bf23ee0a45c1de996731869dc9d6c4
Merge pull request #1494 from yebblies/issue6319

Fix Issue 6319 - debug's relaxed purity does not apply to nested scopes

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #8 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
17:29:52 PST ---
(In reply to comment #7)
 As much as I'd love to make a pull for this I already know I'm going to run
 into Issue 6057 (which has a pull but needs a review).

Looks like I said the same thing as Comment #2. :p

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #9 from hst...@quickfur.ath.cx 2013-01-17 17:36:18 PST ---
If you write static arr = [EnumMembers!T];, you should be able to evade issue
6057.

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #10 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
17:43:00 PST ---
(In reply to comment #9)
 If you write static arr = [EnumMembers!T];, you should be able to evade 
 issue
 6057.

The issue is with unittests.

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


[Issue 6708] immutable ref implicit cast to const ref

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6708



--- Comment #3 from github-bugzi...@puremagic.com 2013-01-17 18:45:15 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/704240e0d391cbf76f45d4d5e8e2a87454494e11
Fix Issue 6708 - immutable ref implicit cast to const ref

https://github.com/D-Programming-Language/dmd/commit/685d943a3af777621476239e200d895c6d375490
Merge pull request #1496 from yebblies/issue6708

Fix Issue 6708 - immutable ref implicit cast to const ref

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


[Issue 9091] Using __traits(getMember) on template argument fails inside member function

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9091



--- Comment #8 from Kenji Hara k.hara...@gmail.com 2013-01-17 20:14:14 PST ---
Unfortunately, this still not be fixed completely.

https://github.com/D-Programming-Language/dmd/pull/1406

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


[Issue 6708] immutable ref implicit cast to const ref

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6708


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


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


[Issue 9337] There's no Duration.max

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9337



--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2013-01-17 20:45:56 
PST ---
https://github.com/D-Programming-Language/druntime/pull/387

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #11 from hst...@quickfur.ath.cx 2013-01-17 21:15:26 PST ---
I don't understand. If you use that line in uniform(), and it works, then
unittests shouldn't have any problems either, no?

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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #12 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-17 
21:21:50 PST ---
(In reply to comment #11)
 I don't understand. If you use that line in uniform(), and it works, then
 unittests shouldn't have any problems either, no?

The problem is the enum has to be hidden in a unittest block like so:

version(unittest)
{
   enum TestEnum { ... }
}

unittest
{
foreach (_; 0 .. 100)
assert(uniform!TestEnum() == ...);
}

And this causes linking problems due to Issue 6057.

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


[Issue 9337] There's no Duration.max

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9337


Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 9339] std.random.uniform!Enum should return random enum member

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9339



--- Comment #13 from hst...@quickfur.ath.cx 2013-01-17 21:35:46 PST ---
Oh? This code compiles  links just fine:

import std.random;
import std.traits;

E randomPick(E)() if (is(E == enum)) {
static members = [ EnumMembers!E ];
return members[uniform(0, EnumMembers!E.length)];
}

void main() {
}

unittest {
enum Fruit { Apple = 12, Mango = 29, Pear = 72 };
foreach (_; 0 .. 100) {
auto f = randomPick!Fruit();
assert(f == Fruit.Apple || f == Fruit.Mango || f ==
Fruit.Pear);
}
}

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


[Issue 9337] There's no Duration.max

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9337



--- Comment #2 from github-bugzi...@puremagic.com 2013-01-17 21:38:15 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/606a6e52c488051708259e6834595c938ad97b8b
Implement issue# 9337: There's no Duration.max.

Added Duration.max and Duration.min.

https://github.com/D-Programming-Language/druntime/commit/e5c84ff3caade03730bbff8055779801448568b7
Merge pull request #387 from jmdavis/time

Implement issue# 9337: There's no Duration.max.

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


[Issue 9344] New: A program takes a console comand as an argument.

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9344

   Summary: A program takes a console comand as an argument.
   Product: D
   Version: D2
  Platform: x86
OS/Version: Linux
Status: NEW
  Severity: major
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: yolk...@gmail.com


--- Comment #0 from yolk...@gmail.com 2013-01-17 22:50:53 PST ---
import std.stdio;

int main(char[][] p_Args) 
{ 
 foreach(char[] l_Arg; p_Args)
 {
   writefln(Argument '%s', l_Arg);
 }
 return 0;
}

/+
Input and output example:

$ ./a.out MY NAME HERE
Argument './a.out'
Argument 'MY'
Argument 'NAME'
Argument 'HERE'

On Ubuntu 12.10 compiled with gdc,the version that can be found on its
repositories.
+/

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


[Issue 9083] mixin expression on template argument doesn't work

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9083


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from Kenji Hara k.hara...@gmail.com 2013-01-17 23:18:23 PST ---
Fixed in 2.061.

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


[Issue 9178] UDA: getAttributes does not play well with tupleof

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9178


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||pull, rejects-valid


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2013-01-17 23:16:13 PST ---
https://github.com/D-Programming-Language/dmd/pull/1505

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


[Issue 9178] UDA: getAttributes does not play well with tupleof

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9178


Jacob Carlborg d...@me.com changed:

   What|Removed |Added

 CC||d...@me.com


--- Comment #2 from Jacob Carlborg d...@me.com 2013-01-17 23:37:05 PST ---
Awesome.

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


[Issue 9338] Compiler segfaults if try to CTFE member function without valid 'this'

2013-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9338


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||ice
Summary|Compiler segfault with  |Compiler segfaults if try
   |template mixin creating |to CTFE member function
   |compile time array  |without valid 'this'


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2013-01-17 23:53:35 PST ---
This is not related to mixin. This code also segfaults:

class Foo
{
void test()
{
enum members = makeArray();
}

string[] makeArray()
{
return [a];
}
}

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