[Issue 6901] New: wrong error override cannot be applied to variable in CTFE forward reference

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

   Summary: wrong error override cannot be applied to variable
in CTFE forward reference
   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-07 01:24:26 PST ---
Applies to both D1 and D2, at least as far back as 2.040. It's a forward
reference error, triggered in this case by CTFE.


class Base6900
{
void foo() {}
}

class Derived6900: Base6900
{
override void foo() { }
}

int test6900()
{
Derived6900 d = new Derived6900;  // for github HEAD
// Derived6900 d = null;   // for older versions
d.foo();
return 1;
}

static assert(test6900());

test.d(8): Error: variable test.Derived6900.foo.this override cannot be applied
to variable
test.d(15):called from here: d.foo()
test.d(19):called from here: test6900()
test.d(19): Error: static assert  (test6900()) is not evaluatable at compile
tim
e

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


[Issue 6902] Different pure nothrow int() types

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


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

   What|Removed |Added

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


--- Comment #1 from Don clugd...@yahoo.com.au 2011-11-07 03:21:28 PST ---
I thought we got rid of those crazy function types. Seems that they've survived
in alias declarations somehow.

The declaration of T shouldn't compile.

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


[Issue 6902] Different pure nothrow int() types

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



--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-11-07 03:33:51 PST ---
Good reducing!
I found a function/delegate literal type inference bug.

I have done Phobos unit tests with my patch, and this resolves Phobos build
breaking in Windows.
http://d.puremagic.com/test-results/test_data.ghtml?dataid=113170

Please wait the patch a while.

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


[Issue 6903] New: Auto Return Doesn't Work With Nested Functions

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

   Summary: Auto Return Doesn't Work With Nested Functions
   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


--- Comment #0 from David Simcha dsim...@yahoo.com 2011-11-07 08:38:26 PST ---
This may technically be an enhancement request, but it seems like a massive,
glaring inconsistency for no good reason, so I consider it a bug.

void main() {
auto foo() {
return 3;
}
}

test.d(2): function declaration without return type. (Note that constructors
are always named 'this')
test.d(2): no identifier for declarator foo()

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


[Issue 6903] Auto Return Doesn't Work With Nested Functions

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2011-11-07 09:34:33 PST ---
See bug 4401

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


[Issue 6903] Auto Return Doesn't Work With Nested Functions

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


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-11-07 09:54:21 PST ---
This is parser problem, and there is no reason to reject it from dmd internally
(e.g. The return type of function literal is almost inferred).

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

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


[Issue 4401] auto functions cannot be inner functions

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


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

   What|Removed |Added

 CC||dsim...@yahoo.com


--- Comment #7 from Kenji Hara k.hara...@gmail.com 2011-11-07 09:54:21 PST ---
*** Issue 6903 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 6904] New: Skip Setting up Stack Frame if No Stack is Used

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

   Summary: Skip Setting up Stack Frame if No Stack is Used
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: performance
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2011-11-07 10:05:40 PST ---
This could affect performance slightly in real-world code if virtual functions
are used to return constants in some overrides.

test.d:

int main() {
   return 0;
}

dmd -c -O -inline -release test.d

Disassembly of _Dmain in test.o:

_Dmain  PROC
pushrbp ;  _ 55
mov rbp, rsp; 0001 _ 48: 8B. EC
xor eax, eax; 0004 _ 31. C0
pop rbp ; 0006 _ 5D
ret ; 0007 _ C3
_Dmain  ENDP

Do we really need to do the push rbp; mov rbp, rsp; pop rbp when the function
doesn't actually use any stack and just sets eax to zero and returns?  GDC
elides these extra instructions.  In GDC, compiled with -O1 or higher, _Dmain's
body is:

_Dmain  PROC
xor eax, eax;  _ 31. C0
ret ; 0002 _ C3
_Dmain  ENDP

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


[Issue 4401] auto functions cannot be inner functions

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


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

   What|Removed |Added

   Platform|x86 |All
 OS/Version|Windows |All


--- Comment #8 from Kenji Hara k.hara...@gmail.com 2011-11-07 10:35:05 PST ---
D2 Patch:
https://github.com/D-Programming-Language/dmd/pull/500

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


[Issue 6905] New: ref acts as auto ref when return type is missing

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

   Summary: ref acts as auto ref when return type is missing
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic andrej.mitrov...@gmail.com 2011-11-07 
11:17:13 PST ---
struct Foo
{
int x;

ref noReturnType()
{
return x;
}
}

void main()
{
auto foo = Foo();
foo.noReturnType = 5;
assert(foo.x == 5);
}

Should this be allowed? It doesn't make much sense, especially when you can
write code like this:

struct Foo
{
ref noReturnType()
{
return 1;  // does an rvalue return
}
}

void main()
{
auto foo = Foo();
auto x = foo.noReturnType();
}

This compiles and only confuses the reader.

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


[Issue 6906] New: Cannot assign value into associative array if contains opAssign

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

   Summary: Cannot assign value into associative array if contains
opAssign
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: jesse.k.phillip...@gmail.com


--- Comment #0 from Jesse Phillips jesse.k.phillip...@gmail.com 2011-11-07 
12:24:00 PST ---
This code fails to compile because the struct S implement opAssign and the
compiler tries using it rather than the associative arrays insert.

void main() {
   S[string] ss;
   S s;

   ss[hello] = s;
}

struct S {
   void opAssign(int i) {
   }
}

test.d(6): Error: function test.S.opAssign (int i) is not callable using
argument types (S)
test.d(6): Error: cannot implicitly convert expression (s) of type S to int
test.d(6): Error: function test.S.opAssign (int i) is not callable using
argument types (S)
test.d(6): Error: cannot implicitly convert expression (s) of type S to int
PS C:\Documents and Settings\jphillips\src\Juno dmd test.d
test.d(5): Error: function test.S.opAssign (int i) is not callable using
argument types (S)
test.d(5): Error: cannot implicitly convert expression (s) of type S to int
test.d(5): Error: function test.S.opAssign (int i) is not callable using
argument types (S)
test.d(5): Error: cannot implicitly convert expression (s) of type S to int

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


[Issue 4401] auto functions cannot be inner functions

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


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

   What|Removed |Added

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


--- Comment #9 from Walter Bright bugzi...@digitalmars.com 2011-11-07 
21:43:53 PST ---
https://github.com/D-Programming-Language/dmd/commit/9f6e32ec88f4137b5030785813cd7b20c94831d5

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


[Issue 6906] Cannot assign value into associative array if contains opAssign

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


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

   What|Removed |Added

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


--- Comment #1 from Don clugd...@yahoo.com.au 2011-11-07 23:07:16 PST ---
I don't think this is a bug. I think the behaviour is intuitive.
ss[hello] = s; looks like an assignment, and it currently behaves like one.
This code doesn't compile, either:

   S[2] ss;
   S s;
   ss[0] = s;

As you've defined it, S cannot participate in any assignment of any kind. You
can't even write:
S s;
S t;
t = s;

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


[Issue 6901] wrong error override cannot be applied to variable in CTFE forward reference

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


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-07 
23:09:24 PST ---
https://github.com/D-Programming-Language/dmd/commit/366a1d759ed45d2aa4bfcb431a0d1ded1f8cf0fc

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

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


[Issue 6416] [CTFE] Declaration static struct is not yet implemented in CTFE

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


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-07 
23:09:45 PST ---
https://github.com/D-Programming-Language/dmd/commit/366a1d759ed45d2aa4bfcb431a0d1ded1f8cf0fc

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

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


[Issue 6907] New: [CTFE] delete statements should be permitted

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

   Summary: [CTFE] delete statements should be permitted
   Product: D
   Version: D1  D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: clugd...@yahoo.com.au


--- Comment #0 from Don clugd...@yahoo.com.au 2011-11-07 23:50:21 PST ---
Although they're not much use, there doesn't seem to be a compelling reason to
disallow them. The spec gets shorter if they're allowed.

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


[Issue 6908] New: [CTFE] C-style variadiac functions should be permitted

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

   Summary: [CTFE] C-style variadiac functions should be permitted
   Product: D
   Version: D1  D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: clugd...@yahoo.com.au


--- Comment #0 from Don clugd...@yahoo.com.au 2011-11-07 23:51:58 PST ---
There doesn't seem to be any reason to disallow them.

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