[Issue 5364] optimizer kills high dword of -1

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5364


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

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2011-11-18 
00:57:46 PST ---
https://github.com/D-Programming-Language/dmd/commit/b1a31e2e9f35e523777467ae74eebfc99a3bb193

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

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


[Issue 6537] OS X optimizer bug (?)

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6537


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #7 from Walter Bright bugzi...@digitalmars.com 2011-11-18 
00:59:46 PST ---
(In reply to comment #6)
 This sounds a lot like bug 5364.

Since 5364 is fixed now, please try it again on OS X.

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


[Issue 6963] pure/nothrow inference doesn't work for function pointers

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6963



--- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-11-18 02:20:42 PST ---
It doesn't occur if the declarations are in function scope.

void foo(X)(X x) {}

// doesn't work
//immutable void function(int) pure bar1 = foo!(int);
//immutable nothrow pure bar2 = foo!(int);

void main()
{
// does work
immutable void function(int) pure bar1 = foo!(int);
immutable nothrow pure bar2 = foo!(int);
}

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


[Issue 6970] New: Pseudo Members

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6970

   Summary: Pseudo Members
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: a11160...@nepwk.com


--- Comment #0 from Matthias Frei a11160...@nepwk.com 2011-11-18 04:07:45 PST 
---
According to TDPL, 5.9.1 Pseudo Members and the @property Attribute, D allows
pseudo-member notation:
if a.fun(b,c,d) is seen but fun is not a member of a's type, D rewrites that
as fun(a,b,c,d) and tries that as well.

Apparantly this is only true for arrays, and even for arrays it does not work
in some cases:

void gun(ref int[]) { }
void sun(ref int[], int v) { }

int[] global;
ref int[] fun() { return global; }
@property ref int[] funProp() { return global; }

void main() {
gun(global);   // works
sun(global, 0);// works
global.gun;// works (but shouldn't ?)
global.gun();  // works
global.sun(0); // works
fun().gun;  // works (but shouldn't ?)
fun().gun();// works
fun().sun(0);   // works
funProp.gun;// works (but shouldn't ?)
funProp.gun();  // does not work but should
funProp.sun(0); // does not work but should
}

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


[Issue 4251] Hole in the const system: immutable values can be overwritten (const(T) is appendable to const(T)[])

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4251


Luther Tychonievich la...@virginia.edu changed:

   What|Removed |Added

Summary|Hole in the type system:|Hole in the const system:
   |Base type reference can be  |immutable values can be
   |assigned to subtype |overwritten (const(T) is
   |reference (Super* is|appendable to const(T)[])
   |treated as a supertype of   |
   |Sub*)   |


--- Comment #17 from Luther Tychonievich la...@virginia.edu 2011-11-18 
05:28:26 PST ---
(In reply to comment #16)
 B x;
 A* y=x; // bad!
Everything you describe is supposed to happen. A* y = x is the point of
inheritance. What exactly is the problem you see in the above? All of your
assert elements seem fine too…

Reverting title. This bug is about the const safety design of the language, not
about inheritance. Even if there is a problem with inheritance, it should be a
separate bug unless you can argue they have the same cause.

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


[Issue 4251] Hole in the const system: immutable values can be overwritten (const(T) is appendable to const(T)[])

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4251



--- Comment #18 from Steven Schveighoffer schvei...@yahoo.com 2011-11-18 
07:10:20 PST ---
(In reply to comment #17)
 (In reply to comment #16)
  B x;
  A* y=x; // bad!
 Everything you describe is supposed to happen. A* y = x is the point of
 inheritance. What exactly is the problem you see in the above? All of your
 assert elements seem fine too…

The example isn't illustrative enough.

Here's a better example:

class A {}
class B : A {void foo() {writeln(hello, B);} }

void main()
{
   B x;
   A* y = x;
   *y = new A;
   x.foo(); // boom!  Call to invalid vtable entry
}

As I said in an earlier comment, this bug is really a dup of bug 2095, but it
adds a different twist.  If we want to consolidate, we should close this as a
duplicate of 2095.

 Reverting title. This bug is about the const safety design of the language, 
 not
 about inheritance. Even if there is a problem with inheritance, it should be a
 separate bug unless you can argue they have the same cause.

It's somewhat the same thing.  const(T) is really a base class of T, since T
implicitly casts to const(T), but const(T) doesn't implicitly cast to T.

I won't revert the bug description again, because I think this case is already
covered in 2095.

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


[Issue 4251] Hole in the const system: immutable(T)[] implicitly casts to ref const(T)[]

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4251


Steven Schveighoffer schvei...@yahoo.com changed:

   What|Removed |Added

Summary|Hole in the const system:   |Hole in the const system:
   |immutable values can be |immutable(T)[] implicitly
   |overwritten (const(T) is|casts to ref const(T)[]
   |appendable to const(T)[])   |


--- Comment #19 from Steven Schveighoffer schvei...@yahoo.com 2011-11-18 
07:12:53 PST ---
However, I just realized the title is not correct.  So I'll change the title to
reflect the actual problem (const(T) is perfectly legal to append to
const(T)[]).

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


[Issue 6971] New: [lex.dd] Type of string literals are outdated

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6971

   Summary: [lex.dd] Type of string literals are outdated
   Product: D
   Version: D2
  Platform: Other
   URL: http://www.d-programming-language.org/lex.html
OS/Version: All
Status: NEW
  Keywords: spec
  Severity: normal
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: k.hanaz...@gmail.com


--- Comment #0 from Kasumi Hanazuki k.hanaz...@gmail.com 2011-11-18 07:21:30 
PST ---
Under section String Literals in the Lexical page it says:

  ---
  helloc // char[]
  hellow // wchar[]
  hellod // dchar[]
  ---

where they should be immutable(char)[], 

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


[Issue 6970] Pseudo Members

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6970


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||cbkbbej...@mailinator.com
 Resolution||DUPLICATE


--- Comment #1 from Nick Sabalausky cbkbbej...@mailinator.com 2011-11-18 
07:33:09 PST ---
Duplicate of issue 3382, issue 2883, and issue 662

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

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


[Issue 3382] TDPL Implement uniform function call syntax

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3382


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

 CC||a11160...@nepwk.com


--- Comment #2 from Nick Sabalausky cbkbbej...@mailinator.com 2011-11-18 
07:33:09 PST ---
*** Issue 6970 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 2883] [UFCS] array member call syntax fails when array is returned from property syntax

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2883


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

Summary|array member call syntax|[UFCS] array member call
   |fails when array is |syntax fails when array is
   |returned from property|returned from property
   |syntax  |syntax


--- Comment #2 from Nick Sabalausky cbkbbej...@mailinator.com 2011-11-18 
07:35:40 PST ---
With current versions of DMD, 'getArray' in the example above should be
@property.

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


[Issue 4251] Hole in the const system: immutable(T)[] implicitly casts to ref const(T)[]

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4251



--- Comment #20 from Andrei Alexandrescu and...@metalanguage.com 2011-11-18 
07:45:55 PST ---
(In reply to comment #19)
 However, I just realized the title is not correct.  So I'll change the title 
 to
 reflect the actual problem (const(T) is perfectly legal to append to
 const(T)[]).

I like Timon's example though, it clarifies quite well a significant problem.

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


[Issue 6537] OS X optimizer bug (?)

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6537


klickverbot c...@klickverbot.at changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #8 from klickverbot c...@klickverbot.at 2011-11-18 08:32:03 PST 
---
Fixed in Git master.

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

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


[Issue 5364] optimizer kills high dword of -1

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5364


klickverbot c...@klickverbot.at changed:

   What|Removed |Added

 CC||c...@klickverbot.at


--- Comment #11 from klickverbot c...@klickverbot.at 2011-11-18 08:32:03 PST 
---
*** Issue 6537 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 6972] New: [CTFE] ICE with ubyte/=uint

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6972

   Summary: [CTFE] ICE with ubyte/=uint
   Product: D
   Version: D1  D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: clugd...@yahoo.com.au


--- Comment #0 from Don clugd...@yahoo.com.au 2011-11-18 12:02:47 PST ---
int blah()
{
ubyte n = 6;
return n /= 2u;
}
static assert(blah()==3);

CTFE internal error: unsupported assignment cast(uint)cast(int)n /= 2u
Assertion failure: 'e1-op == TOKarraylength || e1-op == TOKvar || e1-op ==
TO
Kdotvar || e1-op == TOKindex || e1-op == TOKslice' on line 3193 in file
'inter
pret.c'

Has been hitting this assert since 2.053; before that, it just gave a
unsupported at compile time error.

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


[Issue 6965] [CTFE] wrong reset of variable

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6965


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||INVALID


--- Comment #1 from Don clugd...@yahoo.com.au 2011-11-18 13:07:40 PST ---
That fails at run time, too. You're multiplying by zero!
Should be:   while(--n)

(In reply to comment #0)
 size_t fac(size_t n)
 {
 size_t res = n;
 while (n--)
 res *= n;
 return res;
 }
 
 static assert(fac(3) == 6);
 
 --

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


[Issue 6940] immutable(int*)*/immutable(int)** and int** do not combine

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6940


timon.g...@gmx.ch changed:

   What|Removed |Added

Summary|immutable(int*)* and int**  |immutable(int*)*/immutable(
   |do not combine  |int)** and int** do not
   ||combine


--- Comment #3 from timon.g...@gmx.ch 2011-11-18 13:35:48 PST ---
immutable(int)** and int** should also combine to const(int*)*

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


[Issue 6365] AutoTupleDeclaration

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #38 from bearophile_h...@eml.cc 2011-11-18 18:10:20 PST ---
See also bug 4579

--

Another handy sub-feature. Sometimes you have tuples with N items, but you only
want to unpack some of them. This syntax doesn't work because _ is a valid
variable name (and even if there's only one of them I don't want to define a
_ variable):

auto t = tuple(1, 2.5, hello, 'Z');
immutable (x1, void, s1, void) = t; // only x1 and s1 constants are created


Some dontcare syntax like that void is useful for issue 596 too:


import std.typecons: Tuple;
alias Tuple!(int, x, int, y) Foo;
void main() {
auto f = Foo(1, 2);
switch (f) {
case Foo(1, void): break; // any Foo with x==1, don't care y
default: break;
}
}

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


[Issue 6365] AutoTupleDeclaration

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6365



--- Comment #39 from bearophile_h...@eml.cc 2011-11-18 18:11:33 PST ---
Please ignore the This syntax doesn't work because _ is a valid
variable name (and even if there's only one of them I don't want to define a
_ variable): part of the precedent comment.

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


[Issue 4579] std.typecons.Tuple syntax unpacking sugar

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4579



--- Comment #2 from bearophile_h...@eml.cc 2011-11-18 18:13:42 PST ---
See also issue 6365

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


[Issue 6972] [CTFE] ICE with ubyte/=uint

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6972


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

   What|Removed |Added

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


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2011-11-18 
21:54:52 PST ---
https://github.com/D-Programming-Language/dmd/commit/7816eb5eaaceee107e2e276ab48fdfa07485234a

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

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