[Issue 8521] Internal error: e2ir.c 720 when a function uses a template which relies on that function and -release and -inline are used

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8521


Rainer Schuetze  changed:

   What|Removed |Added

 CC||r.sagita...@gmx.de


--- Comment #3 from Rainer Schuetze  2012-08-21 00:34:00 
PDT ---
I just hit this bug aswell, but your work-around does not seem to help. With
current head from github:

module test;
import std.utf;

dchar foo(string s)
{
size_t pos;
return decode(s, pos);
}


I get ICE with -inline:

>m:\s\d\rainers\windows\bin\dmd -c test.d

>m:\s\d\rainers\windows\bin\dmd -c -inline test.d
Statement::doInline()
goto __returnLabel;

Assertion failure: '0' on line 470 in file 'inline.c'

abnormal program termination

>m:\s\d\rainers\windows\bin\dmd -c -inline -release test.d
decodeImpl(bool canIndex,S) if (is(S : const(char[])) || isInputRange!(S) &&
is(Unqual!(ElementEncod
ingType!(S)) == char))
Internal error: e2ir.c 720

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


[Issue 8521] Internal error: e2ir.c 720 when a function uses a template which relies on that function and -release and -inline are used

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8521



--- Comment #4 from Jonathan M Davis  2012-08-21 00:47:26 
PDT ---
Well, it helps in that the situation is improved enough that dmd's tests passed
(which wasn't the case before), but clearly, it doesn't fully get around the
problem. Bleh.

I guess that I'll have to take another whack at the workaround. It would be
_really_ nice if someone could fix this bug though.

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


[Issue 8571] New: Defined exception for unequal zip lengths with StoppingPolicy.requireSameLength

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8571

   Summary: Defined exception for unequal zip lengths with
StoppingPolicy.requireSameLength
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-08-21 04:41:41 PDT ---
This is part of Zip.empty() of Phobos:


@property bool empty()
{
final switch (stoppingPolicy)
{
...
case StoppingPolicy.requireSameLength:
foreach (i, Unused; R[1 .. $])
{
enforce(ranges[0].empty ==
ranges.field[i + 1].empty,
"Inequal-length ranges passed to Zip");
}
return ranges[0].empty;
}


I suggest to replace that enforce() with a throw of a definite exception, named
like ZipUnequals or something like that, that allows for a clean catch:
catching the enforce() exception is easy, but you can't be sure you are
catching that specific zip enforce instead of another one or a bug.

Knowing that a zip(StoppingPolicy.requireSameLength, ...) has thrown an
exception for unequal lengths is sometimes useful. When you want to use the zip
results and you want to make sure they are equal in length, you want to catch
just that specific length problem.

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


[Issue 8572] New: Bad mismatched nested comments error

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8572

   Summary: Bad mismatched nested comments error
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: minor
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-08-21 04:43:01 PDT ---
This little program:


/+
...
*/


DMD 2.061alpha gives no line number, and a strange looking error message:

Error: Source:Mismatched nested comments in test.d

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


[Issue 8356] Disabled postblit ignored on return statement

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8356



--- Comment #1 from github-bugzi...@puremagic.com 2012-08-21 05:04:56 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b4bc25d72e601436f3999abc5c9c31e464385052
fix Issue 8356 - Disabled postblit ignored on return statement

https://github.com/D-Programming-Language/dmd/commit/d2ba7864be9fce3dc0626020ed8721f68ac7b9b2
Merge pull request #1037 from 9rnsr/fix7579

Issue 7579 & 8356 - Disable postblit ignored on array operation and return
statement

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


[Issue 7579] Disabled postblit ignored and not called by all array operations

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7579



--- Comment #6 from github-bugzi...@puremagic.com 2012-08-21 05:04:48 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/eee6c658ade142f84909503ba463bacecb7cfac9
fix Issue 7579 - Disabled postblit ignored and not called by all array
operations

https://github.com/D-Programming-Language/dmd/commit/d2ba7864be9fce3dc0626020ed8721f68ac7b9b2
Merge pull request #1037 from 9rnsr/fix7579

Issue 7579 & 8356 - Disable postblit ignored on array operation and return
statement

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


[Issue 8573] New: A simpler Phobos function that returns the index of the mix or max item

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8573

   Summary: A simpler Phobos function that returns the index of
the mix or max item
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-08-21 05:05:07 PDT ---
countUntil returns a signed value with the position, or -1 if not found:


import std.algorithm: countUntil;
void main() {
assert(countUntil("hello world", 'r') == 8);
}


But to find the index of the minimum item things become more complex and more
bug-prone:

import std.algorithm: minPos;
import std.range: walkLength;
void main() {
immutable s = "hello world";
immutable sizediff_t mpos = s.walkLength() - minPos(s).walkLength();
assert(mpos == 5);
}

I have typed mpos "sizediff_t" to avoid troubles caused by a unsigned position
value.


In Python taking the sum() of an empty list (array) returns 0, while searching
for min/max in an empty list causes a ValueError exception to be thrown:

>>> a = []
>>> sum(a)
0
>>> min(a)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: min() arg is an empty sequence


In D here mpos is 0:

import std.algorithm: minPos;
import std.range: walkLength;
void main() {
immutable s = "";
immutable sizediff_t mpos = s.walkLength() - minPos(s).walkLength();
assert(mpos == 0);
}


So in Phobos I'd like a simple to use function that returns the sizediff_t
index of the min item (and when the input is empty, it returns -1 or throws an
exception).

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


std.demangle.demangle does not parse symbols that are type names

2012-08-21 Thread Carl Sturtivant


Use of demangle from std.demangle or core.demangle on the mangled 
names in an object or library generated by dmd works only on the 
names of functions, and not on the names of types embedded in 
such objects and libraries.


e.g. the following names are not demangled, being type names 
(ending in Z).


_D13libd_demangle12__ModuleInfoZ
_D15TypeInfo_Struct6__vtblZ
_D3std5stdio12__ModuleInfoZ
_D3std6traits15__T8DemangleTkZ8Demangle6__initZ
_D47TypeInfo_S3std6traits15__T8DemangleTkZ8Demangle6__initZ

Opinion: D should do the right thing and have the facility to 
demangle all of its own mangled names; no-one else will.




[Issue 8516] std.string.representation works incorrect for shared(const(T)) types

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8516


klickverbot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||c...@klickverbot.at
 Resolution||FIXED


--- Comment #3 from klickverbot  2012-08-21 08:31:53 PDT 
---
Fixed in Git master.

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


[Issue 8527] `object.destroy` doesn't destroy interfaces

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8527


klickverbot  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||c...@klickverbot.at
 Resolution||FIXED


--- Comment #3 from klickverbot  2012-08-21 08:31:19 PDT 
---
Fixed in Git master.

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


[Issue 8574] New: [std.format] The flag ' ' works for floating numbers, not only for integers

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8574

   Summary: [std.format] The flag ' ' works for floating numbers,
not only for integers
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: minor
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: lir...@gmail.com


--- Comment #0 from Liremn Yukiha  2012-08-21 08:32:49 PDT ---
In the document of std.format of Phobos
(http://dlang.org/phobos/std_format.html), it is written that the flag ' ' only
affects "integral ('d')" in the table describing the formatting flags, but it
seems that it also works for floating numbers, or even BigInt (with "% d" or "%
s"). So I suppose the last row of the table should be:

' ' / numeric / Prefix positive numbers in a signed conversion with a space.

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


[Issue 8574] [std.format] The flag ' ' works for floating numbers, not only for integers

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8574


Kenji Hara  changed:

   What|Removed |Added

   Keywords||pull
Version|unspecified |D2


--- Comment #1 from Kenji Hara  2012-08-21 08:47:46 PDT ---
Pull request:
https://github.com/D-Programming-Language/phobos/pull/755

> or even BigInt (with "% d" or "% s").

BigInt supports its formatting by the std.format module correctly, so this is
correct behavior.

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


[Issue 8575] New: Lambda expression causes compilation error with template function

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8575

   Summary: Lambda expression causes compilation error with
template function
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: zan77...@nifty.com


--- Comment #0 from SHOO  2012-08-21 09:05:50 PDT ---
This code doesn't work!

template tfunc(fun...) {
auto tfunc(U)(U r) {
return r;
}
}
void bar(T)(T x) {
// import std.functional; x.tfunc!(unaryFun!"a"); // <- OK
x.tfunc!(a=>a); // <- NG
}
void test() {
bar(uint.init);
}
void main() {
bar(int.init);
}

RESULT

$ dmd -run main
Error: function main.bar!(uint).bar.tfunc!(__lambda2).tfunc!(int).tfunc is a
nested function and cannot be accessed from main.bar!(int).bar


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


[Issue 8576] New: unions call destructors of all their fields

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8576

   Summary: unions call destructors of all their fields
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-08-21 09:43:45 PDT ---
Title: 
Component: DMD
Severity: major
Code number: 
Keywords: 
Outcome: wrong_code
Is done: no


import std.stdio;
struct Foo1 {
~this() { writeln("Foo1.dtor"); }
}
struct Foo2 {
~this() { writeln("Foo2.dtor"); }
}
struct Foo3 {
~this() { writeln("Foo3.dtor"); }
}
union U {
Foo1 f1;
Foo2 f2;
Foo3 f3;
}
void main() {
U u;
}


Output:

Foo3.dtor
Foo2.dtor
Foo1.dtor



A comment by Andrei Alexandrescu:
http://forum.dlang.org/thread/cqimoyzvlanjbmuzb...@forum.dlang.org#post-k0eclr:242093:241:40digitalmars.com

> That's pretty surprising. "Major bug" doesn't begin to describe it.
> Unions should call no constructors and no destructors.

-

But maybe there are alternative solutions. Elsewhere I have suggested an
*optional* standard method for unions, to be called at run-time by the garbage
collector to increase its precision when it has to deal with union instances.

When such activeField() method is defined, it may be called at the end of the
scope where the union is defined:


struct Foo {}
struct Bar {}

struct Spam {
bool isBar;

union {
Foo f;
Bar b;

size_t activeField() {
return isBar ? 1 : 0;
}
}
}

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


[Issue 8576] unions call destructors of all their fields

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8576


bearophile_h...@eml.cc changed:

   What|Removed |Added

   Platform|All |x86
 OS/Version|All |Windows
   Severity|normal  |major


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


Re: std.demangle.demangle does not parse symbols that are type names

2012-08-21 Thread Johannes Pfau
Am Tue, 21 Aug 2012 15:34:35 +0200
schrieb "Carl Sturtivant" :

> snip

This newsgroup is only used to accumulate updates from the bug tracker.
Please file your bug report directly at the bug tracker, as long as
it's only a post in this newsgroup it will probably get lost.

http://d.puremagic.com/issues/

If you don't want to file the bug report yourself, I could do that.


[Issue 8339] is(typeof(...)) is reporting true when it's false due to nested function error

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8339



--- Comment #6 from github-bugzi...@puremagic.com 2012-08-21 12:53:13 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a8be86a36d7071092eb6a4a1efddd9552af2581d
fix Issue 8339 - is(typeof(...)) is reporting true when it's false due to
nested function error

https://github.com/D-Programming-Language/dmd/commit/578ba6634f9dbb0eb1e132d46dd14c89542497d6
Merge pull request #1087 from 9rnsr/fix8339

Issue 8339 - is(typeof(...)) is reporting true when it's false due to nested
function error

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


[Issue 8577] New: static assert is triggered after tuple bounds check

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8577

   Summary: static assert is triggered after tuple bounds check
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ellery-newco...@utulsa.edu


--- Comment #0 from Ellery Newcomer  2012-08-21 
13:17:04 PDT ---
I find it very annoying that the following code results in a tuple out of
bounds error message and not only the static assert message.

template T(Ts...) {
static assert(Ts.length > 1);
alias Ts[1] Z;
}

void main() {
alias T!(int).Z Z2;
}

gives

wiz.d(4): Error: tuple index 1 exceeds 1
wiz.d(3): Error: static assert  (1LU > 1LU) is false
wiz.d(8):instantiated from here: T!(int)

I think error reporting should stop at the static assert.

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


[Issue 8339] is(typeof(...)) is reporting true when it's false due to nested function error

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8339


Walter Bright  changed:

   What|Removed |Added

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


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


[Issue 8521] Internal error: e2ir.c 720 when a function uses a template which relies on that function and -release and -inline are used

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8521



--- Comment #5 from Rainer Schuetze  2012-08-21 15:05:28 
PDT ---
It seems that dmd is unable to generate code for the expression

return str[index] < codeUnitLimit!S ? str[index++] : decodeImpl!true(str,
index);

This workaround compiled for me:

if(str[index] < codeUnitLimit!S)
return str[index++];
return decodeImpl!true(str, index);

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


[Issue 8578] New: std.demangle.demangle does not parse symbols that are type names

2012-08-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8578

   Summary: std.demangle.demangle does not parse symbols that are
type names
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: sturtiv...@gmail.com


--- Comment #0 from Carl Sturtivant  2012-08-21 18:29:06 
PDT ---
Use of demangle from std.demangle or core.demangle on the mangled 
names in an object or library generated by dmd works only on the 
names of functions, and not on the names of types embedded in 
such objects and libraries.

e.g. the following names are not demangled, being type names 
(ending in Z).

_D13libd_demangle12__ModuleInfoZ
_D15TypeInfo_Struct6__vtblZ
_D3std5stdio12__ModuleInfoZ
_D3std6traits15__T8DemangleTkZ8Demangle6__initZ
_D47TypeInfo_S3std6traits15__T8DemangleTkZ8Demangle6__initZ

Opinion: D should do the right thing and have the facility to 
demangle all of its own mangled names; no-one else will.

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


Re: std.demangle.demangle does not parse symbols that are type names

2012-08-21 Thread Carl Sturtivant

On Tuesday, 21 August 2012 at 19:08:31 UTC, Johannes Pfau wrote:

Am Tue, 21 Aug 2012 15:34:35 +0200
schrieb "Carl Sturtivant" :


snip


This newsgroup is only used to accumulate updates from the bug 
tracker.
Please file your bug report directly at the bug tracker, as 
long as

it's only a post in this newsgroup it will probably get lost.

http://d.puremagic.com/issues/

If you don't want to file the bug report yourself, I could do 
that.


Understood, and thanks.
I followed the link and put in a bug report.



Re: std.demangle.demangle does not parse symbols that are type names

2012-08-21 Thread dnewbie

Why don't you remove the 'create thread' button from this forum?
Lazy people...