[Issue 5953] Too many trailing commas are accepted

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5953


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

   What|Removed |Added

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


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2011-08-31 
00:36:53 PDT ---
https://github.com/D-Programming-Language/dmd/commit/ba4da917ed6b79fc896a21cec91a0de1a04128cb

https://github.com/D-Programming-Language/dmd/commit/fc0bbd3afba6e5f878fecc8a029f437b1df51e41

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


[Issue 3748] inout does not work properly

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3748


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

   What|Removed |Added

 CC||tomash.brec...@gmail.com


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-08-31 08:07:52 PDT ---
*** Issue 4968 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 4968] inout is sticky to function return type

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4968


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #4 from Kenji Hara k.hara...@gmail.com 2011-08-31 08:07:52 PDT ---
*** This issue has been marked as a duplicate of issue 3748 ***

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


[Issue 3748] inout does not work properly

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3748


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

   What|Removed |Added

   Keywords||patch


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2011-08-31 08:15:03 PDT ---
https://github.com/D-Programming-Language/dmd/pull/359

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


[Issue 6529] writeln(const array of enums) too

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6529


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

   What|Removed |Added

   Keywords||rejects-valid
  Component|Phobos  |DMD
   Platform|x86 |All
 OS/Version|Windows |All
   Severity|enhancement |normal


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-08-31 09:25:23 PDT ---
This is not an issue of std.format, is the issue of dmd.

enum Foo : char { A='a' }
ref const(Foo) f(const(Foo)[] arr){ return arr[0]; }
// test.d(2): Error: arr[0u] isn't mutable

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


[Issue 6529] writeln(const array of enums) too

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6529


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

   What|Removed |Added

   Keywords||patch


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-08-31 10:04:08 PDT ---
https://github.com/D-Programming-Language/dmd/pull/360

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


[Issue 6459] Inline assembler does not work well for 64 bit registers R8..R15

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6459


Graham grahamc00...@yahoo.co.uk changed:

   What|Removed |Added

Version|D1  |D1  D2


--- Comment #1 from Graham grahamc00...@yahoo.co.uk 2011-08-31 10:08:18 PDT 
---
DMD64 D Compiler v2.054 has exactly the same problem.

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


[Issue 6459] Inline assembler does not work well for 64 bit registers R8..R15

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6459


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 CC||bra...@puremagic.com


--- Comment #2 from Brad Roberts bra...@puremagic.com 2011-08-31 10:13:56 PDT 
---
I suspect this is already fixed in git and will go out with the next release.

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


[Issue 6519] Problem with inout and type inference of polysemous types

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6519



--- Comment #3 from Kenji Hara k.hara...@gmail.com 2011-08-31 10:30:12 PDT ---
I think this is a duplication of bug 3748.

With my patch (https://github.com/D-Programming-Language/dmd/pull/359), the
sample code in comment #0 works correctly.

(In reply to comment #2)
 Should the following compile?
int[] x = foo([1,2,3]);
immutable(int[]) y = foo([1,2,3]);
const(int[]) z = foo([1,2,3]);

D's literals work like polysemous value, but basically they have mutable types.

static assert(is(typeof([1, 2]) == int[]));

Therefore typeof(foo([1, 2])) equals to int[], and only y shouldn't compile,
others should.

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


[Issue 3748] inout does not work properly

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3748



--- Comment #4 from Kenji Hara k.hara...@gmail.com 2011-08-31 10:40:24 PDT ---
My patch doesn't forbid to declare inout variable outside inout function.
It is treated same as const variable, even with my patch.

I think it is debatable thing.

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


[Issue 3748] inout does not work properly

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3748



--- Comment #5 from Steven Schveighoffer schvei...@yahoo.com 2011-08-31 
12:11:15 PDT ---
it is not debateable.  The issue is, when inside an inout-enabled function, all
inout variables are *assignable* from other inout variables.

So for example, if you have:

inout(int) * globalvar;

inout(int)* foo(inout(int)* x)
{
   return globalvar;
}

void main()
{
   int x;
   auto y = foo(x);
}

what type is y?  inout(T) is changed to just T in this scenario, since the
constancy factor is mutable, so essentially, you now have a mutable pointer to
what is treated as const as you say.

The type system *must* prevent non-local variables (i.e. variables not on the
stack) from being inout.  Otherwise, you cannot make guarantees about inout.

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


[Issue 6584] New: ICE on large version number/debug level

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6584

   Summary: ICE on large version number/debug level
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-08-31 13:53:59 PDT ---
version(100){}
debug(100){}

Both of those make DMD 2.054 crash with a buffer overrun error message.

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


[Issue 6571] typedefs ignore const, shared, immutable etc modifiers when implicitly converting

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6571



--- Comment #4 from Iain Buclaw ibuc...@ubuntu.com 2011-08-31 15:44:04 PDT ---
I don't have windows so I can't test that. ;)

Everything is fine on the *nix side of things. For std.encoding, just replace
the three 'typedef ubyte' with 'alias ubyte xxx'

Regards

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


[Issue 6585] New: std.variant cannot handle shared arrays

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6585

   Summary: std.variant cannot handle shared arrays
   Product: D
   Version: D2
  Platform: Other
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 2011-08-31 18:39:54 PDT 
---
As discovered during the review for Jonas Drewson's libcurl wrapper,
std.concurrency (correctly, according to TDPL) accepts shared arrays, but
cannot handle them internally:

---
import std.concurrency;
void main() {
  auto tid = spawn(function(){});
  send(tid, cast(shared(int)[])null);
}
---
---
std/variant.d(529): Error: function core.stdc.string.memcpy (void* s1, in
const(void*) s2, uint n) is not callable using argument types
(ubyte[32u]*,shared(int)*,uint)
std/variant.d(529): Error: cannot implicitly convert expression ( rhs) of type
shared(int)* to const(void*)
---

From the error message, the problem seems std.variant trying to copy a
shared(int) to another in its opIndex implementation using memcpy(target,
source, source.sizeof). This fails because shared(int)* isn't implicitly
convertible to const(void*).

The issue can also be demonstrated by the following example directly using
std.variant:

---
import std.variant;
void main() {
  shared(int)[] array;
  auto v = Variant(array);
}
---

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


[Issue 4971] to!() fails with static arrays

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4971


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

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-08-31 21:36:54 PDT ---
std.conv.to now support static array conversion, it is treated as dynamic
array.

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


[Issue 6548] [e2ir.c] Problem with ^^ vector op

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6548



--- Comment #3 from bearophile_h...@eml.cc 2011-08-31 21:52:12 PDT ---
(In reply to comment #2)

 Regards
 Iain

Thank you for your work.

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


[Issue 6586] New: feqrel for const values too

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6586

   Summary: feqrel for const values too
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: rejects-valid
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-08-31 22:09:28 PDT ---
import std.math: feqrel;
void main() {
double x = 1.5;
const double y = 1.5001;
auto d = feqrel(x, y);
}


DMD 2.055head gives me:

test.d(5): Error: template std.math.feqrel(X) if (isFloatingPoint!(X)) does not
match any function template declaration
test.d(5): Error: template std.math.feqrel(X) if (isFloatingPoint!(X)) cannot
deduce template function from argument types !()(double,const(double))


I'd like feqrel to work with mixed const arguments too. Const doubles come from
in function arguments, and they pop out in other situations too, like:


import std.math: feqrel;
double foo(double x)
out(r) {
assert(feqrel(r, x)  10);
}
body {
return x + 0.001;
}
void main() {
foo(1.5);
}


Workaround:


import std.math: feqrel;
double foo(double x)
out(r) {
assert(feqrel(cast()r, x)  10);
}
body {
return x + 0.001;
}
void main() {
foo(1.5);
}




To solve this problem I think that it's enough to replace this:


int feqrel(X)(X x, X y) @trusted pure nothrow
if (isFloatingPoint!(X))
{
/* Public Domain. Author: Don Clugston, 18 Aug 2005.
 */


With something like:

int feqrel(X1, X2)(X1 x, X2 y) @trusted pure nothrow
if (isFloatingPoint!(Unqual!X1)  is(Unqual!X1 == Unqual!X2))
{
/* Public Domain. Author: Don Clugston, 18 Aug 2005.
 */
alias Unqual!X1 X;

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


[Issue 6571] typedefs ignore const, shared, immutable etc modifiers when implicitly converting

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6571



--- Comment #5 from yebblies yebbl...@gmail.com 2011-09-01 15:22:20 EST ---
(In reply to comment #4)
 I don't have windows so I can't test that. ;)
 

Since phobos and druntime don't use typedef any more, there should be no
reliance on this bug any more.  Would you like to make a pull request?

 Everything is fine on the *nix side of things. For std.encoding, just replace
 the three 'typedef ubyte' with 'alias ubyte xxx'

This didn't work for me for some reason, I think the module relies on them
being distinct types.  Using enums instead solved the problem.

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


[Issue 4566] Calling functions in parallel with std.concurrency

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4566


Andrew Wiley debio...@gmail.com changed:

   What|Removed |Added

 CC||debio...@gmail.com


--- Comment #2 from Andrew Wiley debio...@gmail.com 2011-08-31 22:33:50 PDT 
---
This pattern works well using the thread pool provided by std.parallelism, but
the problems with immutable data going into and being returned from the
function call still remain. I'm currently getting around this by casting to and
from shared, but do you have any new thoughts on the Unique!T suggestion?

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


[Issue 6587] New: std.parallelism

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6587

   Summary: std.parallelism
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: debio...@gmail.com


--- Comment #0 from Andrew Wiley debio...@gmail.com 2011-08-31 22:34:42 PDT 
---


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


[Issue 2634] Function literals are non-constant.

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2634


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #3 from yebblies yebbl...@gmail.com 2011-09-01 15:38:27 EST ---
Fixed for D2

https://github.com/D-Programming-Language/dmd/commit/8945eae1b37f1fdc96850cff697959deb2d64e6a

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


[Issue 6587] std.parallelism's Task cannot handle immutable values

2011-08-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6587


Andrew Wiley debio...@gmail.com changed:

   What|Removed |Added

   Platform|Other   |All
Summary|std.parallelism |std.parallelism's Task
   ||cannot handle immutable
   ||values
 OS/Version|Windows |All


--- Comment #1 from Andrew Wiley debio...@gmail.com 2011-08-31 22:39:40 PDT 
---
When creating Tasks to run on a TaskPool using std.parallelism, it looks like I
can't call functions that have immutable objects:

code:
import std.parallelism;

class Test {
}

void doSomething(immutable(Test) test) {
}

void main() {
immutable(Test) test = new immutable(Test)();
taskPool().put(task!(doSomething)(test));
}


compiler output:
Error: can only initialize const member __args_field_0 inside constructor
Error: this is not mutable
/usr/include/d2/4.6.0/std/parallelism.d:734: Error: template instance
std.parallelism.Task!(doSomething,immutable(Test)) error instantiating
tasktest.d:11:instantiated from here:
task!(doSomething,immutable(Test))


Is this something that can be fixed, or does this depend on having tail const
support (which would hopefully work for immutable as well)? This use case seems
particularly important as immutability is the simplest way to ensure safe
multithreading.

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