[Issue 2634] Function literals are non-constant.

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


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

   What|Removed |Added

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


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2011-08-31 
23:24:22 PDT ---
And D1:

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

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


[Issue 6551] struct constructor not recognized when forward referenced

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6551


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

   What|Removed |Added

 CC||clugd...@yahoo.com.au
Version|unspecified |D2
Summary|[CTFE] struct constructor   |struct constructor not
   |not recognized under weird  |recognized when forward
   |conditions  |referenced


--- Comment #1 from Don clugd...@yahoo.com.au 2011-09-01 04:30:48 PDT ---
This isn't a CTFE bug. Reduced test case:

uint NINE = 9;
typeof(F(NINE)) fails;

struct F
{
ubyte th;
this(uint x)
{ th = cast(ubyte) x; }
}

This is a forward reference issue. It compiles if you move the declaration of
'fails' past the declaration of F.

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


[Issue 5373] Regression (2.051) CTFE and std.string.replace() causes Bad binary function q{a == b}..

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5373


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

   What|Removed |Added

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


--- Comment #11 from Don clugd...@yahoo.com.au 2011-09-01 04:51:58 PDT ---
(In reply to comment #10)
 replace is broken again in 2.054.
 I get the Bad binary function q{a == b} with my code but this example 
 doesn't
 even get so far:
 Error: argument to mixin must be a string, not (['i','n','t',' ','a',';'])

That's bug 2156, which is completely different to this one. It has nothing to
do with CTFE.

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


[Issue 6588] New: Struct d'tors + immutable elements doesn't work

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6588

   Summary: Struct d'tors + immutable elements doesn't work
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com
Blocks: 6587


--- Comment #0 from David Simcha dsim...@yahoo.com 2011-09-01 06:36:00 PDT ---
struct Task(Args...) {

Args _args;

this(Args args) {
_args = args;
}

~this() {}  // Bug goes away without this.

}

alias Task!(int function(immutable int), immutable(int)) F;

Error: can only initialize const member __args_field_1 inside constructor
Error: this is not mutable

-- 
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-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6587


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 CC||dsim...@yahoo.com


--- Comment #2 from David Simcha dsim...@yahoo.com 2011-09-01 06:38:52 PDT ---
This should work, but I had neglected to put a test in for it.  Anyhow, the
underlying reason it doesn't work is Bug 6588.

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


[Issue 6589] New: is(int*==int*); and template X(T : int*=int*) should compile

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6589

   Summary: is(int*==int*); and template X(T : int*=int*) should
compile
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-09-01 10:04:51 PDT ---
is(int*==int*) / template X(T : int*=int*) do not compile because they are
tokenized as

is ( int *= = int *)
template X ( T : int *= int * )

The parser could explicitly check for the *= = token combination / the *=
token.
What this would add is that the compiler can actually parse all programs
generated from the D grammar. It would solve a similar language problem C++98
had with the XYint.

I think this should not add more than 10 LOC to the parser in total.

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


[Issue 5915] Newlines are not propagated when copypasting code snippets

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5915



--- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2011-09-01 
10:15:19 PDT ---
Can anyone else confirm this?

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


[Issue 6586] feqrel for const values too

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


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

   What|Removed |Added

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


--- Comment #1 from Don clugd...@yahoo.com.au 2011-09-01 12:06:31 PDT ---
I hit this myself a couple of days ago.
I prefer:

int feqrel(X)(const(X) x, const(X) y) @trusted pure nothrow
if (isFloatingPoint!(X))

which causes less template bloat, and also avoids some unpleasant issues where
x and y are different sizes.

I'm not really sure why double and const(double) need to be different types. It
causes a huge amount of template bloat, and I don't think we're getting much
(if anything) in return.

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


[Issue 6558] [CTFE] UTF-decoding foreach gives wrong index (1-indexed)

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6558


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

   What|Removed |Added

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


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2011-09-01 
12:12:57 PDT ---
https://github.com/D-Programming-Language/dmd/commit/43fc4a3cdd48a3109a98e8c78de2f1c2bfe28842

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

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


[Issue 6581] Yet another dtor/postblit problem?

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6581



--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2011-09-01 
13:21:38 PDT ---
Simplifyied. My best guess is that postlblits for struct members are not
called.

struct A
{
static int cnt;
this(int dummy){ cnt++; }
this(this){ cnt++; }
~this(){ cnt--; }
}
struct B
{
A a;
static int cnt;
this(int dummy){ a = a(dummy); cnt++; }
this(this){ cnt++; }
~this(){ cnt--; }
}

void main()
{
{
B b = B(42);
}
assert(B.cnt == 0);//passes
assert(A.cnt == 0);//fails A.cnt == -1
}

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


[Issue 6590] New: mixed in case and default statements do not create a new scope

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6590

   Summary: mixed in case and default statements do not create a
new scope
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-09-01 13:28:03 PDT ---
consider

void main(){
int x;
switch(x){
case 0: auto e=1; break;
case 1: auto e=2; break; // fine
default: auto e=3; break; // fine
}
switch(x){
case 0: auto e=1; break;
mixin(case 1:); auto e=2; break; //error
mixin(default:); auto e=3; break;// error
}
}

tested with DMD 2.054

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


[Issue 6581] Yet another dtor/postblit problem?

2011-09-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6581



--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2011-09-01 
13:58:35 PDT ---
It might be more complicated then I thought, postblits of members do work.
I'd better leave the cause of problem to thouse in the know. Another variation
of test:

import std.stdio;

struct A
{
static int ctor, post, dtor;

this(int dummy){ ctor++; }
this(this){ post++; }
~this(){ dtor++; }
}

struct B
{
A a;
static int ctor, post, dtor;
this(int dummy){ 
a = A(dummy); // a(dummy) was a typo, thought it changes nothing
ctor++; 
}
this(this){ post++; }
~this(){ dtor++; }
}


void main()
{
{
B b = B(42);
auto c = b;
}
// all works as long as it's shallow
assert(B.post == 1);
assert(B.ctor == 1);
assert(B.dtor == 2);

writefln(%s %s %s, A.ctor, A.post, A.dtor);//prints 1 1 3
assert(A.ctor == 1);
assert(A.post == 1);
assert(A.dtor == 2);//fails
}

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