[Issue 6510] [CTFE] "internal error: illegal stack value" when compiled with -inline

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



--- Comment #9 from Don  2011-08-19 05:53:36 PDT ---
Further reduced, showing that templates are not required. Seems to require an
inlined member function call to a member of a nested struct, called from a
nested function. No alias trick works in this case.

struct Stack6510 {
struct Proxy { 
void shrink() {}
}
Proxy stack;
void pop() {
stack.shrink();
}
}

int bug6510() {
static int used() {
Stack6510 junk;
junk.pop();
return 3;
}
return used();
}

void main() {
static assert(bug6510()==3);
}

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


[Issue 5710] cannot use delegates as parameters to non-global template

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



--- Comment #10 from David Simcha  2011-08-19 07:03:02 PDT 
---
(In reply to comment #9)
> My idea:
> doStuff receives a context pointer that points 'an array of context pointers'.
> Backend receives code like follows...
> 
> uint doStuff(uint a, uint b, void** this)  // not void* this
> {
> // (*this + 0) points the object Foo
> // (*this + 1) points the stack frame of main()
> 
> //return fun(a, b);
> return fun(a, b, (*this + 1));
> }
> 
> Caller of doStuff have to create array of context pointers.
> 
> void main(){
> ...
> //foo.doStuff!add(1, 2);
> void*[2] thisarray = [(stack frame of main), foo];
> doStuff(a, b, thisarray.ptr);
> }

Sounds great if you can pull it off.  I was thinking the same thing, but I'm
not familiar enough with the DMD codebase to know how easy/hard it would be to
implement.  This would remove some really silly/annoying limitations from
std.parallelism.

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


[Issue 6531] New: assertion failure in std.range.iota

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

   Summary: assertion failure in std.range.iota
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: major
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-08-19 
07:49:29 PDT ---
import std.range;
import std.stdio;

void main()
{
   auto r1 = iota(0.0, 4.0, 0.03);  // ok
   auto r2 = iota(0.0, 3.0, 0.03);  //
core.exception.AssertError@std.range(4001): Assertion failure
}

I want a range in steps of 0.03, beginning at 0.0 and ending at the
closest point to 3.0.

Line 4001 is:
assert(start + count * step >= end);

There's no documentation, and no custom assert message, so I don't know what
was the intention of the author.

It doesn't help that this fails in debug mode but works fine in release mode.

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


[Issue 6147] file scheme uri from file path and vice versa

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


Mariusz GliwiƄski  changed:

   What|Removed |Added

   Severity|trivial |enhancement


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


[Issue 1001] print stack trace (in debug mode) when program die

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



--- Comment #56 from Sean Kelly  2011-08-19 14:12:24 
PDT ---
If you want exceptions for these events on Posix, create a signal handler and
throw one.  On some OSes it will work and on others it won't.  Assuming you're
targeting a platform where it works though, doing so might be a net win.

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


[Issue 6533] New: Compiler should catch duplicate overrides

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

   Summary: Compiler should catch duplicate overrides
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2011-08-19 
19:26:40 PDT ---
class Foo
{
abstract void foo();
}

class Bar : Foo
{
override void foo() 
{
// code
}

override void foo() { }
}

void main() {}

This ends up being a linker error such as:  Offset 00542H Record Type 00C3
 Error 1: Previous Definition Different : _D12overridetest3Bar3fooMFZv

The problem is in a large class you might end up mistakenly defining an
overriden function twice, and you won't get a compile-time error, you will get
a linker error instead.

Making this a compile-time error would be an improvement.

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


[Issue 6534] New: const struct definition inside functions too

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

   Summary: const struct definition inside functions too
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-08-19 23:22:23 PDT ---
void foo() {
const struct Bar {}
}
void main() {}


DMD 2.055beta:

test.d(2): basic type expected, not struct
test.d(2): no identifier for declarator int
test.d(2): semicolon expected, not 'struct'

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


[Issue 6534] const struct definition inside functions too

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



--- Comment #1 from bearophile_h...@eml.cc 2011-08-19 23:42:15 PDT ---
The same happens with static structs:


void foo() {
static const struct Bar {}
}
void main() {}

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