[Issue 6114] New: immutable class variable not properly initialized when the constructor initializing it is non-shared

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6114

   Summary: immutable class variable not properly initialized when
the constructor initializing it is non-shared
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis jmdavisp...@gmx.com 2011-06-05 23:31:52 
PDT ---
This is related to bug# 6113. If you go into std.datetime and change the static
constructors which initialize UTC._utc or LocalTime._localTime (search for
_utc = or _localTime = - minus the quotes - to find them quickly), then
this code will fail:

import std.datetime;

shared static this()
{
  assert(UTC() !is null);
  assert(LocalTime() !is null);
}

void main()
{}


As long as those static constructors are shared, then this code is fine. But if
they're not shared, then the assertions fail. I believe that this is related to
bug# 4923 and the fact that immutable global variables and immutable static
variables are implicitly shared. I really think that the language should be
altered such that it be an error to attempt to initialize an immutable global
variable or immutable static variable in a non-shared constructor. Since,
they're implicitly shared, it doesn't make sense to initialize them in a
thread-local manner anyway. And it's obviously causing problems as-is.

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


[Issue 6113] singletons in std.datetime are not created early enough

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6113


Jonathan M Davis jmdavisp...@gmx.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Platform|Other   |All
 OS/Version|Windows |All


--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2011-06-05 23:37:20 
PDT ---
There's now a pull request with the fixes:
https://github.com/D-Programming-Language/phobos/pull/81

Given the simplicity of the change, I expect that it'll be merged in fairly
quickly.

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


[Issue 6113] singletons in std.datetime are not created early enough

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6113


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

   What|Removed |Added

 CC||bra...@puremagic.com


--- Comment #2 from Brad Roberts bra...@puremagic.com 2011-06-06 00:00:14 PDT 
---
While changing them to shared static ctors is a good change, I there might well
be a real bug here anyway.

For the main thread's initialization, should it run through all shared static
ctors then all non-shared static ctors as two passes?  Or, should it run
through all shared static and non-shared statics together in one pass?

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


[Issue 6113] singletons in std.datetime are not created early enough

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6113



--- Comment #3 from Jonathan M Davis jmdavisp...@gmx.com 2011-06-06 00:13:27 
PDT ---
That's why I opened bug# 6114. I'm going to close this one once my fix has been
merged in, since that fixes the problem with std.datetime. But there _is_ a
compiler bug here. Bug# 6114 covers that.

Everything that I've read says that the static constructors are supposed
supposed to be run in lexical order within a module, and the the compiler will
order the initialization of the modules such that they're run in the order
necessary to initialize everything before it's used. I haven't seen anything
that would indicate that hared static constructors should be treated any
differently from other static constructors as far as initialization order goes.

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


[Issue 6090] DDoc parenthesis escape issues.

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6090


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-06-06 
00:18:06 PDT ---
https://github.com/D-Programming-Language/dmd/commit/f8e7f05c2161a2b99286f58bcb4c8295459860dd

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

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

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


[Issue 4107] Duplicate documentation for member function templates

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4107


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

   What|Removed |Added

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


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2011-06-06 
00:19:29 PDT ---
https://github.com/D-Programming-Language/dmd/commit/f8e7f05c2161a2b99286f58bcb4c8295459860dd

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

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

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


[Issue 6114] immutable class variable not properly initialized when the constructor initializing it is non-shared

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6114


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

   What|Removed |Added

 CC||bra...@puremagic.com


--- Comment #1 from Brad Roberts bra...@puremagic.com 2011-06-06 00:21:37 PDT 
---
While you've framed this as related to immutable (and I agree with your
assessment), there's a broader problem of the definition of order of
initialization.  For the main thread, is it one or two passes?

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


[Issue 6109] 'nothrow' does not check slice indices

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6109


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED
 OS/Version|Mac OS X|All


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2011-06-06 
00:38:37 PDT ---
https://github.com/D-Programming-Language/dmd/commit/c516c2e0024908b19f7ce9b9b1836aabf4dbfb75

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


[Issue 6094] doesn't shortcut properly with CTFE

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6094


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

   What|Removed |Added

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


--- Comment #7 from Don clugd...@yahoo.com.au 2011-06-06 01:45:43 PDT ---
(In reply to comment #4)
 Unless I'm missing something, actually intermixing evaluation and semantic
 analysis enough to pull this sort of thing off would be enormously intrusive.
 
 Additionally, do we _really_ want compile time code execution semantics to be
 that different from runtime execution semantics?  My gut says, No way.

There are *no* existing instances where CTFE ever does semantic analysis.
CTFE happens far too late for that. In fact CTFE isn't involved at all, the
desired behaviour would happen in the constant folding step -- but it doesn't
do semantic analysis either.
This would seem to be a request to change the semantics of the  operator to
allow things like:

enum bool XXX = false  undefined;
to compile. As well as being complicated to implement, I really don't think
that would be a good idea. It would introduce a corner case:

bool YYY = false  undefined;  // doesn't compile, still won't compile?
const bool ZZZ = false  undefined; // I think this must be forbidden.

is(typeof(false  undefined)) presumably would still return false, even though
it does compile in the XXX case.

Would any of these compile?

bool foo(bool z) { return z; }
enum bool AAA = foo(false  undefined);
enum int BBB = (false  undefined) ? 7 : 3;
enum int CCC = false ? undefined : 6;
enum bool DDD = true || undefined;
enum bool BBB = !((true || undefined))  undefined2;

The thing which is particularly difficult about implementing this, is that you
cannot run the semantic pass on the second branch of an  expression, until
you have run the optimizer pass on the first branch.

And what happens with this:
enum bool CCC = is(typeof(false  undefined));
Currently that returns false.

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


[Issue 5673] Add lookahead and forgetful matching support std.regex

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5673


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 CC||a...@akbkhome.com


--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
02:17:15 PDT ---
*** Issue 1394 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 5169] Add(?:) Non-capturing parentheses group support to std.regex

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5169


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #4 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
02:27:19 PDT ---
*** This issue has been marked as a duplicate of issue 5673 ***

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


[Issue 5673] Add lookahead and forgetful matching support std.regex

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5673



--- Comment #3 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
02:27:19 PDT ---
*** Issue 5169 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 3383] newVoid

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3383



--- Comment #3 from bearophile_h...@eml.cc 2011-06-06 03:26:11 PDT ---
One case worth considering:

auto mat = new int[5][5];
foreach (row; mat)
row[] = 10;

The way used to initialize a matrix to void is useful to initialize all of it
to a defined value too.

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


[Issue 6075] Cannot set value to associative array from a weakly-pure function when the value type has a (pure) opAssign

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6075



--- Comment #1 from kenn...@gmail.com 2011-06-06 03:27:16 PDT ---
The bug was introduced in commit 44d7881 (fix bug 2451), manifesting itself as
a Segfault (null pointer dereferencing).

The Segfault was later converted to an error in commit 37aacfc (bug 5131).

https://github.com/D-Programming-Language/dmd/commit/44d7881
https://github.com/D-Programming-Language/dmd/commit/37aacfc

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


[Issue 4154] Incorrect DWARF section names on Mac

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4154



--- Comment #12 from Jacob Carlborg d...@me.com 2011-06-06 03:47:12 PDT ---
So DMD should invoke dsymutil?

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


[Issue 5936] Regression(2.050): Segfault when forward-referencing pure auto-return member function with parameter.

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5936


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

   What|Removed |Added

   Keywords||patch
 CC||clugd...@yahoo.com.au
Summary|DMD Segfault when   |Regression(2.050): Segfault
   |forward-referencing pure|when forward-referencing
   |auto-return member function |pure auto-return member
   |with parameter. |function with parameter.


--- Comment #1 from Don clugd...@yahoo.com.au 2011-06-06 06:18:17 PDT ---
The segfault is a simple null pointer dereference which can easily be patched.

mtype.c, TypeFunction::parameterEscapes, line 5369

if (purity)
{   /* With pure functions, we need only be concerned if p escapes
 * via any return statement.
 */
-Type* tret = nextOf()-toBasetype();
-if (!isref  !tret-hasPointers())
+Type* tret = nextOf() ? nextOf()-toBasetype() : NULL;
+if (!isref  tret  !tret-hasPointers())
{   /* The result has no references, so p could not be escaping
 * that way.
 */
return FALSE;
}

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


[Issue 5936] Regression(2.050): Segfault when forward-referencing pure auto-return member function with parameter.

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5936



--- Comment #2 from Don clugd...@yahoo.com.au 2011-06-06 06:21:15 PDT ---
*** Issue 5844 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 5844] DMD crash on infinite-recursive variadic template pure auto function

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5844


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

   What|Removed |Added

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


--- Comment #1 from Don clugd...@yahoo.com.au 2011-06-06 06:21:15 PDT ---
The patch in 5936 also fixes this.

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

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


[Issue 3843] Signed lengths (and other built-in values)

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3843


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||INVALID


--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com 2011-06-06 
06:27:39 PDT ---
At this point it's virtually impossible to turn lengths to signed types.

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


[Issue 3136] Incorrect and strange behavior of std.regexp.RegExp if using a pattern with optional prefix and suffix longer than 1 char

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3136


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #3 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:03:48 PDT ---
Fixed for std.regex
https://github.com/D-Programming-Language/phobos/commit/9afb00e36b625322d7f1d8ec0fbd876c2b5c03fc

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


[Issue 2108] regexp.d: The greedy dotstar isn't so greedy

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2108


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #7 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:02:43 PDT ---
Fixed for std.regex:
https://github.com/D-Programming-Language/phobos/commit/9afb00e36b625322d7f1d8ec0fbd876c2b5c03fc

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


[Issue 4574] std.regex : breaks with empy string regex

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4574


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution||FIXED


--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:11:08 PDT ---
Fixed in version 2.053
https://github.com/D-Programming-Language/phobos/commit/da4a902341af2607199e0e23e9f954294d09bf2c

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


[Issue 4367] std.regex: Captures is not a random access range

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4367


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution||FIXED


--- Comment #3 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:10:36 PDT ---
Apparently fixed in version 2.053
https://github.com/D-Programming-Language/phobos/commit/b68db973064ac7ad149cc42c3b4dc5416b576d21

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


[Issue 5019] In std.regex, empty capture at end of string causes error

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5019


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution||DUPLICATE


--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:18:29 PDT ---
*** This issue has been marked as a duplicate of issue 5511 ***

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


[Issue 5511] std.regex optional capture with no-match cause error

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5511


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:27:40 PDT ---
Fixed in version 2.053
https://github.com/D-Programming-Language/phobos/commit/ee612d047c8c8a840fb601180306f65ec28c7853

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


[Issue 5673] Add lookahead and forgetful matching support std.regex

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5673



--- Comment #4 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:29:32 PDT ---
Fixed in version 2.053
https://github.com/D-Programming-Language/phobos/commit/ee612d047c8c8a840fb601180306f65ec28c7853

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


[Issue 5673] Add lookahead and forgetful matching support std.regex

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5673


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 5857] std.regex (...){n, m} is bogus when (...) contains repetitions

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5857


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:35:03 PDT ---
Fixed in 2.053
https://github.com/D-Programming-Language/phobos/commit/c3ec6b2387d50ceab14cb648de6abb96b2b11f33

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


[Issue 6076] std.regex: c.*|d matches mm

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6076


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution||FIXED


--- Comment #2 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:35:41 PDT ---
Fixed:
https://github.com/D-Programming-Language/phobos/commit/9afb00e36b625322d7f1d8ec0fbd876c2b5c03fc

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


[Issue 4627] Ideas for std.regex.match usage syntax

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4627


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 CC||dmitry.o...@gmail.com


--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
08:41:35 PDT ---
It works exactly like that.

Keeping in mind that captures is a range [full match, submatch0, submatch1,
...] fro a given match.
And foreach (m; match(text, r\d)) { ... } iterates over consecutive matches
of regex (if g option is set, otherwise it's one iteration).

Resolved ?

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


[Issue 4154] Incorrect DWARF section names on Mac

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4154



--- Comment #13 from Robert Clipsham rob...@octarineparrot.com 2011-06-06 
17:50:58 BST ---
I believe so, there's not a lot of point right now though, given that the
binaries produced by dmd cause dsymutil to fail. Struggling to find out what
needs changing to stop dsymutil failing.

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


[Issue 6115] New: Variadic documentation should import core.vararg.

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6115

   Summary: Variadic documentation should import core.vararg.
   Product: D
   Version: D2
  Platform: Other
   URL: http://www.digitalmars.com/d/2.0/function.html
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: jesse.k.phillip...@gmail.com


--- Comment #0 from Jesse Phillips jesse.k.phillip...@gmail.com 2011-06-06 
09:51:14 PDT ---
Documentation for Variadic functions still import std.stdarg. The module is
replaced with core.vararg.

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


[Issue 3843] Signed lengths (and other built-in values)

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3843



--- Comment #2 from bearophile_h...@eml.cc 2011-06-06 10:17:33 PDT ---
(In reply to comment #1)
 At this point it's virtually impossible to turn lengths to signed types.

I understand.

A note: in Bugzilla I have some issues open regarding little D improvements. If
they don't happen in something like another year, it will probably be quite
harder to perform those changes, even if they are appreciated. I am open for
any question about those issues.

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


[Issue 4627] Ideas for std.regex.match usage syntax

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4627



--- Comment #2 from bearophile_h...@eml.cc 2011-06-06 10:33:45 PDT ---
(In reply to comment #1)
 Resolved ?

You have improved the D regular expressions a lot, it seems.

To me this program crashes at runtime (DMD 2.053):


import std.stdio, std.regex;
void main() {
foreach (m; match(125 155 ss25, r\d+))
writeln(m);
}


If I use this line it works:
writeln(m.toString());

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


[Issue 4627] Ideas for std.regex.match usage syntax

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4627



--- Comment #3 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
10:43:32 PDT ---
Yeah, that's very embarassing bug related to writeln/formattedWrite. 
The reason is that toString seems to have less priority then range formatting.
And ranges that return elements of the same type as range itself are unexpected
in that formatting code.

In essence, it's the same issue as this one
http://d.puremagic.com/issues/show_bug.cgi?id=4604


So let's keep thing where they belong and if you have no futher things for this
bugzilla, I think you should close it. 

And I think adding this simple example in issue 4604 won't hurt.

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


[Issue 6105] static: doesn't qualify static this constructors

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6105


Dan Sănduleac sanduleac@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #1 from Dan Sănduleac sanduleac@gmail.com 2011-06-06 10:56:51 
PDT ---
Sorry about that, apparently that's the way it's supposed to work.
http://www.digitalmars.com/d/2.0/class.html#StaticConstructor

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


[Issue 4604] A stack overflow with writeln

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4604



--- Comment #1 from bearophile_h...@eml.cc 2011-06-06 11:09:15 PDT ---
Dmitry Olshansky has suggested me to add this that comes from issue 4627:

To me this program crashes at runtime (DMD 2.053):


import std.stdio, std.regex;
void main() {
foreach (m; match(125 155 ss25, r\d+))
writeln(m);
}


If I use this line it works:
writeln(m.toString());

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


[Issue 6085] The filename part of a thrown core.exception.UnicodeException is incomprehensible

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6085


kenn...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from kenn...@gmail.com 2011-06-06 12:30:15 PDT ---
https://github.com/D-Programming-Language/druntime/commit/d1ae5aa395a5a545f48c0c92d4338de19e6f3887

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


[Issue 5925] Comparing associative array with a type constructor (const/shared/immutable) causes segfault

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5925


kenn...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from kenn...@gmail.com 2011-06-06 12:32:23 PDT ---
https://github.com/D-Programming-Language/druntime/commit/b2bbaee6ffbc316b67278ce35bfa6ab73db17a7d

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


[Issue 1983] Big Hole in Const System

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1983


Rob Jacques sandf...@jhu.edu changed:

   What|Removed |Added

 CC||sandf...@jhu.edu


--- Comment #6 from Rob Jacques sandf...@jhu.edu 2011-06-06 12:42:15 PDT ---
(In reply to comment #3)
 Janice Caron wrote:
   --- Comment #1 from fvbom...@wxs.nl  2008-04-10 05:55 ---
   IMHO the problem here isn't the type of (a.x) but the fact that it's 
  allowed
   to compile at all.
  
  Same thing. You just stated the problem differently.
  
  a.x = 2;
  
  won't compile because a.x is typed const. Wheras
  
  (a.x)(2);
  
  will compile because (a.x) is not typed const. The fact that it
  compiles is a /symptom/.
 
 I disagree. As long as (a.x) for mutable a and const x (and similar 
 cases with invariant, etc.) doesn't compile, there's no need for 
 'delegate() const'. See below.
 
   We can treat the symptom, but I'd rather
  treat the disease. To treat the disease, the type system must allow
  types such as
  
  ReturnType delegate(Params...) const
  
  to exist. Likewise
  
  ReturnType delegate(Params...) invariant
  
  and eventually, we're even going to need
  
  ReturnType delegate(Params...) invariant pure
 
 I can see the need for the pure variant, but not any of the others. I 
 see no reason to distinguish between a delegate to a const method and 
 one to a normal method, as long as you can't create a delegate to a 
 method using an object of inappropriate constness.
 Who (except again in case of 'pure') cares if the object pointed to by 
 the void* .ptr changes if the method is called? Obviously whoever 
 created the delegate must have had mutable access to it[1] (since that 
 should IMHO be the only way to create such a delegate), so they have 
 every right to create a delegate that mutates it.
 
 In other words: since you don't have a useful explicit reference to the 
 object, who cares if it's const or not?
 
 
 [1] Or invoked undefined behavior by somehow casting away const, in 
 which case it doesn't matter *what* happens.

const delegates are extremely important to parallelism and concurrency, i.e.
the routines in std.parallelism. This is because calling a const delegate from
multiple threads is _safe_, given guarantees that mutating members/delegates
won't be called until after synchronization barriers. (i.e. using const
delegates provides race-safety to parallel foreach, reduce, etc.) (Well, except
for the corner case of accessing a global shared variable)

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


[Issue 5003] regex(replace with delegate) sample doesn't work

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5003


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution||WORKSFORME


--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2011-06-06 
13:18:54 PDT ---
Works on dmd 2.053.

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


[Issue 6111] Escaping reference to local variable not detected

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6111



--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2011-06-06 
15:57:49 PDT ---
Reduced test case:

import std.c.stdio;

auto mymap()
{
int x = 42;
int fun(int a) { return x + a; }

auto map()(int r)
{
struct Result
{
int _input;

int back()
{
return fun(_input);
}

this(int input)
{
_input = input;
}
}

return Result(r);
}

return map(1);
} 

void main()
{
printf(%d\n, mymap().back());
}

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


[Issue 6116] New: May not join spawn()'ed threads

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6116

   Summary: May not join spawn()'ed threads
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: major
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: acehr...@yahoo.com


--- Comment #0 from Ali Cehreli acehr...@yahoo.com 2011-06-06 16:33:09 PDT ---
Version: 2.053

The command line:

~/dmd2.053/linux/bin64/dmd deneme.d  -ofdeneme  -unittest -J. -w  

Although I have multiple threads spawning each other here, I also had problems
with just a single thread spawned from main. I wanted to keep this example as
it exposes many different outputs for me.

import std.stdio;
import std.concurrency;
import core.thread;

void foo()
{
foreach (i; 0 .. 5) {
Thread.sleep(dur!msecs(500));
writeln(i,  foo);
}
}

void intermediate3()
{
spawn(foo);
writeln(intermediate3 done);
}

void intermediate2()
{
spawn(intermediate3);
writeln(intermediate2 done);
}

void intermediate()
{
spawn(intermediate2);
writeln(intermediate done);
}

void main()
{
spawn(intermediate);
writeln(main done);
}

1) ThreadException:

$ time ./deneme
main done
intermediate done
intermediate2 done
intermediate3 done
core.thread.ThreadException@src/core/thread.d(866): Unable to join thread



real0m0.003s
user0m0.000s
sys0m0.000s

2) No output from foo() (foo() is not joined)

$ time ./deneme
main done
intermediate done
intermediate2 done
intermediate3 done

real0m0.003s
user0m0.000s
sys0m0.000s

3) Segmentation fault:

$ time ./deneme
main done
intermediate done
Segmentation fault

real0m0.003s
user0m0.000s
sys0m0.000s

4) Expected behavior:

$ time ./deneme
main done
intermediate done
intermediate2 done
intermediate3 done
0 foo
1 foo
2 foo
3 foo
4 foo

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


[Issue 6116] May not join spawn()'ed threads

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6116



--- Comment #1 from Ali Cehreli acehr...@yahoo.com 2011-06-06 16:38:06 PDT ---
Apparently I clipped the timings for the last run. When it joins successfully,
the program takes long, seemingly waiting for the foo() thread:

$ time ./deneme
main done
intermediate done
intermediate2 done
intermediate3 done
0 foo
1 foo
2 foo
3 foo
4 foo

real0m2.504s
user0m0.000s
sys0m0.000s

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


[Issue 6117] New: Parameter names of equivalent function aliases are merged

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6117

   Summary: Parameter names of equivalent function aliases are
merged
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  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-06-06 
16:44:01 PDT ---
void function(int a, int b) x;
void function(int c, int d) y;

void main()
{
writeln(typeof(x).stringof);
writeln(typeof(y).stringof);
}

Prints:
void function(int a, int b)
void function(int a, int b)

It seems the two alias get merged into one, and y will resolve to x. I don't
know what else could cause the loss of parameter names for y in this case.

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


[Issue 6111] Escaping reference to local variable not detected

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6111


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2011-06-06 
17:23:56 PDT ---
https://github.com/D-Programming-Language/dmd/commit/20510a31133327d768ae5335c5fbfc3e611a1213

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


[Issue 6118] New: nested overloaded foreach in contract crashes dmd

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6118

   Summary: nested overloaded foreach in contract crashes dmd
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: viritrilbi...@gmail.com


--- Comment #0 from Mike Shulman viritrilbi...@gmail.com 2011-06-06 17:34:52 
PDT ---
The following code crashes DMD v2.053 with Internal error: ../ztc/cgcs.c 363:


class foo {
  int opApply(int delegate(ref int) dg) const { return 0; }

  foo bar()
out(result) {
  foreach (x ; result)
foreach (y ; result)
  assert(x);
}
  body { return this; }
}


I haven't been able to simplify the code any further and still reproduce the
crash.  Removing the second foreach makes it compile, as does replacing
assert(x) with anything not referring to x.

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


[Issue 3797] Regression(2.038): Implicit conversion between incompatible function pointers

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3797



--- Comment #13 from yebblies yebbl...@gmail.com 2011-06-06 19:33:41 PDT ---
*** Issue 4891 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 4891] Assignment from non-pure function to pure function pointer compiles when it shouldn't

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4891


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||DUPLICATE


--- Comment #3 from yebblies yebbl...@gmail.com 2011-06-06 19:33:40 PDT ---
This is a dupe of 3797, the purity of a function pointer (among other things)
is not checked when performing implicit conversions.

With dmd pull 88 you get the following error from dmd:
testx.d(26): Error: constructor testx.S.this (int function(int) pure func) is
no
t callable using argument types (int function(int num))
testx.d(26): Error: cannot implicitly convert expression ( add1) of type int
fu
nction(int num) to int function(int) pure

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

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


[Issue 5434] Function pointers not properly typechecked

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5434


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||DUPLICATE


--- Comment #1 from yebblies yebbl...@gmail.com 2011-06-06 19:39:53 PDT ---
With my proposed fix to 3797, this gives the error:

testx.d(7): Error: cannot implicitly convert expression ( GetX) of type void
fu
nction(short _param_0, short _param_1, short i) to void function(string)

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

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


[Issue 3797] Regression(2.038): Implicit conversion between incompatible function pointers

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3797


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||eatingstap...@gmail.com


--- Comment #14 from yebblies yebbl...@gmail.com 2011-06-06 19:39:53 PDT ---
*** Issue 5434 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 5421] Ref function pointers can only be made with auto

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5421


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||DUPLICATE


--- Comment #2 from yebblies yebbl...@gmail.com 2011-06-06 19:46:53 PDT ---
*** This issue has been marked as a duplicate of issue 2753 ***

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


[Issue 3797] Regression(2.038): Implicit conversion between incompatible function pointers

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3797



--- Comment #15 from yebblies yebbl...@gmail.com 2011-06-06 20:01:10 PDT ---
The reason this happens is because TypeFunction does not override constConv. 
When called on TypeFunction, TypeNext::constConv is actually called, which only
compares the return type. (next in TypeFunction is the return type)

I've created a possible fix in dmd pull 88 which defines
TypeFunction::constConv to disallow most implicit conversions between function
pointers.

The current patch allows reasonable purity, safety and nothrow conversions.  If
you're interested, please take a look and see if all cases are covered.

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


[Issue 5986] Function pointers wrongly typed

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5986


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #2 from yebblies yebbl...@gmail.com 2011-06-06 21:04:57 PDT ---
The reason the second method works is because of issue 3797.

The fact that ClassType.nonstaticmethod returns an invalid function pointer is
definitely a bug.

But what should it do?
I see the following options:
 1. Disallow it completely - you can still get the address from a delegate's
function pointer
 2. Make it return void*
 3. Make it return a callable function pointer that matches the abi for member
function calls.

I'm not sure what sensible use cases there are for getting the address of a
member function, but 1 seems the most reasonable.

The original bug report asks for 3, but that does not seem particularly useful.
eg.
 auto funcptr = Class.func;
 auto instance = new Class();
 funcptr(instance);

vs
 auto instance = new Class();
 instance.func();

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


[Issue 2509] Compiler rejects inner function that return references

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2509


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||DUPLICATE


--- Comment #2 from yebblies yebbl...@gmail.com 2011-06-06 21:28:24 PDT ---
*** This issue has been marked as a duplicate of issue 5959 ***

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


[Issue 5828] Cannot declare a variable of type X function() ref

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5828


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||DUPLICATE


--- Comment #2 from yebblies yebbl...@gmail.com 2011-06-06 21:26:33 PDT ---
*** This issue has been marked as a duplicate of issue 2753 ***

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


[Issue 2753] Cannot declare pointer to function returning ref

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2753


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||timon.g...@gmx.ch


--- Comment #8 from yebblies yebbl...@gmail.com 2011-06-06 21:26:33 PDT ---
*** Issue 5828 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: ---