[Issue 8734] Compiler must verify exe path is writable before attempting compilation

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8734



--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2012-09-28 
23:29:56 PDT ---
I think it would slow things down in general.

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


[Issue 8734] Compiler must verify exe path is writable before attempting compilation

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8734


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX


--- Comment #4 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-09-29 
08:54:30 PDT ---
(In reply to comment #3)
 I think it would slow things down in general.

Ok I'm closing it. Anyway here's a win32 batch workaround:
@echo off
set exePath=test.exe
echo x  %exePath% || goto :ERROR

goto :EOF
:ERROR
echo Can't write to %exePath%.

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


[Issue 8736] New: DMD should translate slashes in -of on Windows

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8736

   Summary: DMD should translate slashes in -of on Windows
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot c...@klickverbot.at 2012-09-29 14:06:15 PDT 
---
Currently, using slashes in DMD paths works in a cross-platform manner
everywhere except for the -of argument. The latter gets passed verbatim to
OPTLINK, which can only handle backslashes.

This is quite annoying because it needs special cases in for cross-platform,
cross-compiler build systems, see e.g.
https://github.com/apache/thrift/blob/trunk/aclocal/ax_dmd.m4#L68.

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


[Issue 8737] New: Associative Array (AA) KeyType is not Unqual-able

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8737

   Summary: Associative Array (AA) KeyType is not Unqual-able
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: monarchdo...@gmail.com


--- Comment #0 from monarchdo...@gmail.com 2012-09-29 15:42:26 PDT ---
There is an issue with AA's, where it is not possible to extract the exact
mutable KeyType of an AA. This is a built in protection for when iterating on
reference keys.

The problem is that it becomes impossible to create new keys, without knowing
the real type.

This was revealed in a bug in conv.to : #8705
http://d.puremagic.com/issues/show_bug.cgi?id=8705

Reduced test:


import std.stdio;
import std.traits;
import std.conv;

void main()
{
alias short[short[short]] S;
alias int[int[int]] T;
S value;
T result;

alias Unqual!(KeyType!T)   K2; // const(int)[int]
alias Unqual!(ValueType!T) V2; // int

foreach (k1, v1; value)
{
K2 k2 = to2!K2(k1); //request a cast to const(int)[int] !!!
V2 v2 = to!V2(v1);
result[k2] = v2;
}
}

T to2(T, S)(S value) //T is const(int)[int]
{
alias Unqual!(KeyType!T)   K2;
alias Unqual!(ValueType!T) V2;
Unqual!T result;

foreach (k1, v1; value)
{
K2 k2 = to!K2(k1); //const(int)
V2 v2 = to!V2(v1); //int
result[k2] = v2; //Error: result[k2] isn't mutable (naturally)
}
return result;
}

Here, the implementer of foo is unable to tranform his keys, because their
types are not mutable.

The real problem is that KeyType returned const(int)[int], is not really
const, but not mutable either. Because of this Unqual doesn't work.

Suggestion: The type returned by KeyType should be full const, eg:
const(int[int]).

This would make it just as safe, but a user can still request an Unqual on the
type.

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


[Issue 8737] Associative Array (AA) KeyType is not Unqual-able

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8737



--- Comment #1 from monarchdo...@gmail.com 2012-09-29 15:55:11 PDT ---
(In reply to comment #0)
 Here, the implementer of foo is unable to tranform his keys, because their
 types are not mutable.

I meant to

 The real problem is that KeyType returned const(int)[int], is not really
 const, but not mutable either. Because of this Unqual doesn't work.
 
 Suggestion: The type returned by KeyType should be full const, eg:
 const(int[int]).

No, wait that is bad advice. Recommend changing Unqual actually;


template Unqual(T)
if(!isAssociativeArray!T) //New condition
{
//As it was
}

//New overload
template Unqual(T)
if(isAssociativeArray!T)
{
alias KeyType!T K;
alias Unqual!(ValueType!T) V;
alias V[K] Unqual;
}


I'll do this tommorrow, unless I get some objections?

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


[Issue 8733] Normalize -of path on Windows

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8733


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

   What|Removed |Added

 CC||c...@klickverbot.at


--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-09-29 
16:58:38 PDT ---
*** Issue 8736 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 8736] DMD should translate slashes in -of on Windows

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8736


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 2012-09-29 
16:58:37 PDT ---
(In reply to comment #0)
 Currently, using slashes in DMD paths works in a cross-platform manner
 everywhere except for the -of argument. The latter gets passed verbatim to
 OPTLINK, which can only handle backslashes.
 
 This is quite annoying because it needs special cases in for cross-platform,
 cross-compiler build systems, see e.g.
 https://github.com/apache/thrift/blob/trunk/aclocal/ax_dmd.m4#L68.

Guess that counts as vote++. :)

*** This issue has been marked as a duplicate of issue 8733 ***

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


[Issue 8128] unittest blocks should be allowed in interfaces

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8128



--- Comment #3 from github-bugzi...@puremagic.com 2012-09-29 18:52:28 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e1f95f3251c9af20dd6d655c9ee022a51e3cce0c
Fix issue 8128 - allow unittest blocks in interfaces.

https://github.com/D-Programming-Language/dmd/commit/1d70dced6dc1f784eb6469d30637efa5ae85701b
Merge pull request #960 from alexrp/interface-unittest

Fix issue 8128 - allow unittest blocks in interfaces.

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


[Issue 8738] New: Struct assignment constructor order of operations DMD 2.0.6

2012-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8738

   Summary: Struct assignment constructor order of operations DMD
2.0.6
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: adamsib...@hotmail.com


--- Comment #0 from adamsib...@hotmail.com 2012-09-29 22:35:13 PDT ---
DMD 2.0.6 

This behaviour seems inconsistent and unintuitive:

void main() {
int[3] a = [1,2,3]; // The array is fine
a = [4, a[0], 6];

struct S { // The stuct is the problem
int a, b, c;
}

S s = S(1,2,3);
s = S(4, s.a, 6);

assert(a == [4,1,6]); // What I'd expect
assert(s == S(4,4,6)); // Unhelpful
}

Setting the struct writes s.a before evaluating it while the 
reverse is true of the array assignment. GDC 
does what I'd expect and gives both as 4,1,6. This seems to be a bug to me, it
creates an easy to miss bug and behaves differently to another common data
structure and to the same data structure with a different compiler.

Creating a custom constructor for the struct fixes the issue:

struct S {
int a, b, c;

this(int a, int b, int c)
{
this.a = a;
this.b = b;
this.c = c;
}
}

assert(s == S(4,1,6));

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