[Issue 4618] New: std.algorithm.reduce over fixed-size array (regression)
http://d.puremagic.com/issues/show_bug.cgi?id=4618 Summary: std.algorithm.reduce over fixed-size array (regression) Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Severity: regression Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: s...@extrawurst.org --- Comment #0 from Stephan Dilly s...@extrawurst.org 2010-08-11 01:51:41 PDT --- this used to work in dmd2.047 since dmd2.048 it does not [CODE] import std.algorithm; void main() { int[3] colSum; auto average = reduce!(a + b)(0, colSum); } [/CODE] dmd complains: main.d(9): Error: template std.algorithm.reduce!(a + b).reduce(Args...) if (Args.length 0 Args.length = 2 isInputRange!(Args[__dollar - 1])) does not match any function template declaration main.d(9): Error: template std.algorithm.reduce!(a + b).reduce(Args...) if (Args.length 0 Args.length = 2 isInputRange!(Args[__dollar - 1])) does not match any function template declaration -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3202] std.math.pow cause dead loop
http://d.puremagic.com/issues/show_bug.cgi?id=3202 ZY Zhou rin...@gmail.com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2275] std.utf.toUTF16z() should return const(wchar)*
http://d.puremagic.com/issues/show_bug.cgi?id=2275 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #2 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:42:01 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3355] std.string.cmp works incorrectly for mixed-type and different-length strings
http://d.puremagic.com/issues/show_bug.cgi?id=3355 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #2 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:43:04 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3386] to!bool(string) is not implemented
http://d.puremagic.com/issues/show_bug.cgi?id=3386 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #2 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:43:28 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3447] std.file uses unconventional file permissions
http://d.puremagic.com/issues/show_bug.cgi?id=3447 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #4 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:44:40 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3202] std.math.pow cause dead loop
http://d.puremagic.com/issues/show_bug.cgi?id=3202 --- Comment #3 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:43:44 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3853] core.sys.posix.stdio.pclose is missing
http://d.puremagic.com/issues/show_bug.cgi?id=3853 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #1 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:45:34 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4327] std.container.Array.Range.~this() tries to call free(T[])
http://d.puremagic.com/issues/show_bug.cgi?id=4327 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #2 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:46:29 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3782] The POSIX sys/un.h header
http://d.puremagic.com/issues/show_bug.cgi?id=3782 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #5 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-11 02:45:10 PDT --- Fixed DMD 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4619] New: Can't link with std.intrinsic function(s)
http://d.puremagic.com/issues/show_bug.cgi?id=4619 Summary: Can't link with std.intrinsic function(s) Product: D Version: D2 Platform: x86_64 OS/Version: Windows Status: NEW Severity: regression Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: ing...@libertysurf.fr --- Comment #0 from Rod�ric Vicaire ing...@libertysurf.fr 2010-08-11 02:58:01 PDT --- With DMD2.047 DMD2.048 when I import std.intrinsic and try to use bsr(...) , I get the following OptLink error: Error 42: Symbol Undefined _D3std9intrinsic12__ModuleInfoZ -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3961] Error with to!(somestruct)
http://d.puremagic.com/issues/show_bug.cgi?id=3961 bearophile_h...@eml.cc changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #3 from bearophile_h...@eml.cc 2010-08-11 04:13:56 PDT --- The bug is absent in 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4618] std.algorithm.reduce over fixed-size array (regression)
http://d.puremagic.com/issues/show_bug.cgi?id=4618 Thorsten Richter i...@gmx.de changed: What|Removed |Added CC||i...@gmx.de --- Comment #1 from Thorsten Richter i...@gmx.de 2010-08-11 04:24:58 PDT --- I'm wondering why this bug made it to the release version because it was already brought up on the beta mailing list. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4619] Can't link with std.intrinsic function(s)
http://d.puremagic.com/issues/show_bug.cgi?id=4619 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #1 from Don clugd...@yahoo.com.au 2010-08-11 04:46:05 PDT --- Please post a complete example. I cannot reproduce it on Win32. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4341] compiling with -unittest on win32 produces invalid executable
http://d.puremagic.com/issues/show_bug.cgi?id=4341 Adrian Matoga e...@atari8.info changed: What|Removed |Added CC||e...@atari8.info --- Comment #1 from Adrian Matoga e...@atari8.info 2010-08-11 04:51:01 PDT --- Seems like it's fixed in 2.048. Compiles and runs correctly with and without unittests. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4593] (DMD 2.047) Access Violation in unittest build
http://d.puremagic.com/issues/show_bug.cgi?id=4593 Adrian Matoga e...@atari8.info changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #6 from Adrian Matoga e...@atari8.info 2010-08-11 04:54:30 PDT --- Seems like it's fixed now with 2.048. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4620] New: C++ constructor and template mangling, C++ ABI patch
http://d.puremagic.com/issues/show_bug.cgi?id=4620 Summary: C++ constructor and template mangling, C++ ABI patch Product: D Version: D1 D2 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: matthias.fauconn...@gmail.com --- Comment #0 from Matthias Fauconneau matthias.fauconn...@gmail.com 2010-08-11 05:10:46 PDT --- Created an attachment (id=712) Demo: using Qt through native C++ interface (without compiled bindings) --- a/cppmangle.c 2010-08-11 13:28:34.0 +0200 +++ b/cppmangle.c 2010-08-11 13:28:34.0 +0200 @@ -106,14 +106,36 @@ Dsymbol *p = s-toParent(); if (p !p-isModule()) { +TemplateInstance *ti = p-isTemplateInstance(); +if(ti) +{ +char *name = ti-name-toChars(); +buf-printf(%d%s, strlen(name), name); +buf-writeByte('I'); +for (size_t j = 0; j ti-tiargs-dim; j++) +{ +Object *o = (Object *)ti-tiargs-data[j]; +Type *t = isType(o); +if (t) t-toCppMangle(buf, cms); +} +buf-writeByte('E'); +return; +} + buf-writeByte('N'); FuncDeclaration *fd = s-isFuncDeclaration(); -if (fd-isConst()) +if (fd fd-isConst()) buf-writeByte('K'); prefix_name(buf, cms, p); -source_name(buf, s); +cms-components.push(s); +if (!strcmp(s-ident-toChars(), __ctor)) { +buf-writeByte('C'); +buf-writeByte('1'); +} else { +source_name(buf, s); +} buf-writeByte('E'); } @@ -197,10 +219,11 @@ * zellipsis * u source-name # vendor extended type */ - -if (isConst()) +if (isConst()) { +if (cms-substitute(buf, this)) +return; buf-writeByte('K'); - +} switch (ty) { case Tvoid: c = 'v';break; @@ -320,6 +343,11 @@ void TypeStruct::toCppMangle(OutBuffer *buf, CppMangleState *cms) { +if (isConst()) +{ +if ( !cms-substitute(buf, this) ) +buf-writeByte('K'); +} if (!cms-substitute(buf, sym)) cpp_mangle_name(buf, cms, sym); } --- a/expression.c 2010-08-11 13:16:54.0 +0200 +++ b/expression.c 2010-08-11 13:16:54.0 +0200 @@ -6741,6 +6741,10 @@ e = new DotTemplateExp(loc, av, td); } e = new CallExp(loc, e, arguments); +if (cf cf-linkage != LINKd) +{ //C++ constructor return void +e = new CommaExp(loc, e, new VarExp(loc, tmp)); +} #if !STRUCTTHISREF /* Constructors return a pointer to the instance */ --- a/e2ir.c2010-08-11 11:51:32.0 +0200 +++ b/e2ir.c2010-08-11 11:51:32.0 +0200 @@ -137,7 +137,7 @@ { Parameter *p = Parameter::getNth(tf-parameters, i - j); -if (p-storageClass (STCout | STCref)) +if (p-storageClass (STCout | STCref) || (p-type-ty == Tstruct tf-linkage != LINKd)) { // Convert argument to a pointer, // use AddrExp::toElem() @@ -1733,11 +1733,18 @@ if (member) { // Call constructor ez = callfunc(loc, irs, 1, type, ez, ectype, member, member-type, NULL, arguments); +TypeFunction* tf = (TypeFunction *)(member-type); +if (tf-linkage != LINKd) +{ //C++ constructor return void +ez = el_combine(ez, el_same(ex)); +} #if STRUCTTHISREF -/* Structs return a ref, which gets automatically dereferenced. - * But we want a pointer to the instance. - */ -ez = el_una(OPaddr, TYnptr, ez); +else { +/* Structs return a ref, which gets automatically dereferenced. +* But we want a pointer to the instance. +*/ +ez = el_una(OPaddr, TYnptr, ez); +} #endif } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4620] C++ constructor and template mangling, C++ ABI patch
http://d.puremagic.com/issues/show_bug.cgi?id=4620 --- Comment #1 from Matthias Fauconneau matthias.fauconn...@gmail.com 2010-08-11 05:15:03 PDT --- Created an attachment (id=713) Patch against r615 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3319] DInstaller overwrites the %PATH% variable
http://d.puremagic.com/issues/show_bug.cgi?id=3319 Ary Borenszweig a...@esperanto.org.ar changed: What|Removed |Added CC||a...@esperanto.org.ar --- Comment #1 from Ary Borenszweig a...@esperanto.org.ar 2010-08-11 06:11:00 PDT --- This might help: http://forums.winamp.com/showthread.php?postid=2496643 (since the installer is written in NSIS...) But I'm still not sure what the fix could be... maybe checking for the value before and after changing it, as it suggests... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3971] Syntax semantics for array assigns
http://d.puremagic.com/issues/show_bug.cgi?id=3971 --- Comment #13 from bearophile_h...@eml.cc 2010-08-11 08:39:21 PDT --- While compiling this program: void main() { int[1] a1; int[1] a2[] = a1[]; } compatibility with C syntax produces this error message: test.d(3): Error: cannot implicitly convert expression (a1[]) of type int[] to int[1u][] See also bug 4580 as a way to solve this problem. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4542] TDPL NVI example results in linker error
http://d.puremagic.com/issues/show_bug.cgi?id=4542 Jonathan M Davis jmdavisp...@gmail.com changed: What|Removed |Added CC||jmdavisp...@gmail.com --- Comment #2 from Jonathan M Davis jmdavisp...@gmail.com 2010-08-11 10:13:06 PDT --- NVI is a highly useful idiom, and generally-speaking, dmd is supposed to come in line with TDPL rather than TDPL being in error. So, I'd definitely argue that the access level should have nothing to do with the overridability of a function, regardless of what was originally intended for D. We have final if we want to make functions non-overridable. There's no need to overload access level to make it do the same thing. I'd say that dmd and the spec should come in line with TDPL in this case. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] New: Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 Summary: Destructors are inherently u...@safe Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: michel.for...@michelf.com --- Comment #0 from Michel Fortin michel.for...@michelf.com 2010-08-11 14:08:33 EDT --- Accessing the GC heap through a member in a destructors is inherently unsafe because the GC might have already freed that memory. So destructors in SafeD should not be able to access the GC-heap through a member. Here is an example: @safe: class C { C other; ~this() { writeln(other.toString()); // other might already have been freed. } } void main() { C c1 = new C; C c2 = new C; c1.other = c2; c2.other = c1; // creating a circular reference } Given that the compiler has no way to know if a reference, pointer, or array points to the GC heap or elsewhere, it might have to disallow any dereferencing of any member and calls to functions that might dereference a member. And at this point you can't do anything useful in a destructor, so you might just disallow @safe destructors altogether. Note that this applies to struct destructors too, since structs can be on the heap (in their own memory block, part of an array, or as a member of a class). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4622] New: Module constructor is not called under some circumstances
http://d.puremagic.com/issues/show_bug.cgi?id=4622 Summary: Module constructor is not called under some circumstances Product: D Version: D2 Platform: Other OS/Version: Linux Status: NEW Severity: critical Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: michal.min...@gmail.com --- Comment #0 from Michal Minich michal.min...@gmail.com 2010-08-11 11:27:21 PDT --- Module constructor is not called when it is placed in imported module and WinMain/custom runtime initialization is used (it does not happens when ordinary main is used or when static this is in main module). module hello; import core.runtime; import std.c.windows.windows; import std.stdio; import a; extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int result; void exceptionHandler (Throwable ex) { throw ex; } Runtime.initialize(exceptionHandler); result = myWinMain(); Runtime.terminate(exceptionHandler); return result; } int main () { writeln (i1); // -- - prints 1 wich is ok. writeln (i2); // prints 0 wich is incorrect, should be 2. return 1; } module a; int i1 = 1; int i2; static this () { i2 = 2; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 --- Comment #2 from Michel Fortin michel.for...@michelf.com 2010-08-11 14:37:52 EDT --- Perhaps a better solution for structs: have a way to distinguish between a struct that can be put on the GC heap and one that cannot. A struct that cannot go on the GC heap make it safe to access GC-managed members in its destructor, and thus can have a @safe destructor. But at the same time such a struct would be prohibited at compile time from being part of a class, or from being allocated with new (either solitary or part of an array). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 Jonathan M Davis jmdavisp...@gmail.com changed: What|Removed |Added CC||jmdavisp...@gmail.com --- Comment #1 from Jonathan M Davis jmdavisp...@gmail.com 2010-08-11 11:36:33 PDT --- What about structs which are on the stack? I agree that the stuff on the heap has this problem, but structs on the stack should be fine, shouldn't they? I'd hate for structs on the stack not be able to have destructors except in SafeD. It would make RAII only work in SafeD, which would not be good. I do agree that destructors on the heap should be disallowed in SafeD, but I don't want to see structs on the heap not being allowed to have destructors in SafeD. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 --- Comment #3 from Jonathan M Davis jmdavisp...@gmail.com 2010-08-11 11:43:00 PDT --- Ouch. That last sentence of my needs editing. I meant to say that I don't want to see structs on the _stack_ not being allowed to have destructors in SafeD. But obviously you understood what I meant. As for your suggestion, couldn't the compiler just disallow structs with destructors from anywhere but the stack in SafeD? If you try and declare them anywhere else, you'd get an error. There shouldn't be any need to distinguish them otherwise. The destructor itself could do that. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4623] New: Non-integer type allowed as static array size
http://d.puremagic.com/issues/show_bug.cgi?id=4623 Summary: Non-integer type allowed as static array size Product: D Version: D1 D2 Platform: All OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: ibuc...@ubuntu.com --- Comment #0 from Iain Buclaw ibuc...@ubuntu.com 2010-08-11 11:44:22 PDT --- The code: void main() { int[0.128] a; } Should not compile, rather error with the message stating that either the size of array 'a' has non-integer type, or that the compiler cannot implicitly convert expression (0.128) of type double to uint. See: http://dstress.kuehne.cn/nocompile/o/opIndex_05.d Regards -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4624] New: std.stdio.File and std.typecons.Unique not GC-heap safe
http://d.puremagic.com/issues/show_bug.cgi?id=4624 Summary: std.stdio.File and std.typecons.Unique not GC-heap safe Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: michel.for...@michelf.com --- Comment #0 from Michel Fortin michel.for...@michelf.com 2010-08-11 15:28:53 EDT --- Just took a look at Phobos for struct destructors. Both std.stdio.File and std.typeconst.Unique seem unsafe to store anywhere in the GC heap (in an array or in a class). For std.stdio.File, it's because because the destructor assumes the GC-allocated Impl instance can be dereferenced (which is a risky bet during the collection that the GC will deallocate things in the right order): this(string name, in char[] stdioOpenmode = rb) { p = new Impl(errnoEnforce(.fopen(name, stdioOpenmode), Cannot open file `~name ~' in mode `~stdioOpenmode.idup~'), 1, name); } ~this() { if (!p) return; // @@@BUG@@@ These lines prematurely close the file //printf(Destroying file `%s' with %d refs\n, toStringz(p.name), p.refs); if (p.refs == 1) close; else --p.refs; } In struct std.typecons.Unique(T), unique calls delete on the object it references, but since that object is in the GC heap the same problem arises: it might already have been deallocated: ~this() { writeln(Unique destructor of , (_p is null)? null: _p); delete _p; _p = null; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 --- Comment #4 from Michel Fortin michel.for...@michelf.com 2010-08-11 15:33:11 EDT --- The problem with structs is that many structs will need a destructor because they encapsulate a resource not managed by the GC. That destructor can be made GC-heap safe, and thus this struct can be put in a class. For instance, a File struct wrapping a file handle could easily be made GC-heap safe if it's destructor just calls fclose(handle), and thus could be put in a class. Are you willing to make this File struct unusable in SafeD? Or std.container.Array, which is totally safe to use on the heap too? So I think there is a need to distinguish GC-safe structs from those that aren't. Forbidding all structs with a destructor to be put on the heap in SafeD is going to prevent too many useful things. Obviously, the struct itself would need a @trusted destructor. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 314] [module] Static, renamed, and selective imports are always public
http://d.puremagic.com/issues/show_bug.cgi?id=314 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #18 from Don clugd...@yahoo.com.au 2010-08-11 12:48:59 PDT --- I have tried this patch on the latest D2. I've found two problems with it: (1) object needs special treatment, it must not default to private. (2) It completely fails for selective imports. The first issue is trivial to fix; the main patch in import.c becomes: void Import::importAll(Scope *sc) { if (!mod) { load(sc); mod-importAll(0); + /* Default to private importing, except for object. +*/ + if (id != Id::object) { +protection = sc-protection; + if (!sc-explicitProtection) +protection = PROTprivate; + } OTOH applying the patch has shown up several bugs in druntime and in the compiler test suite. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 --- Comment #5 from Jonathan M Davis jmdavisp...@gmail.com 2010-08-11 13:10:28 PDT --- This mess is just too complicated. Sigh. Well, we want to be able to use structs with destructors in SafeD wherever is reasonable to use them, and those uses should be allowed. Unsafe uses should not be allowed. If attributes of some kind are required on the structs or their destructors to make it work, then that's the path that we should take. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4621] Destructors are inherently u...@safe
http://d.puremagic.com/issues/show_bug.cgi?id=4621 --- Comment #6 from Michel Fortin michel.for...@michelf.com 2010-08-11 16:20:44 EDT --- It could be an attribute, or it could be something else. For instance, instead of having just destructors, we could have destructors (~this) and finalizers (~~this). A struct with neither can go anywhere, a struct with a destructor but no finalizer cannot go on the GC-heap, a struct with only a finalizer can go anywhere (the finalizer is used as the destructor), and a struct with both can go anywhere. The finalizer cannot be made @safe. Doing this with structs would probably mean allowing only finalizers (~~this) for classes, which according to my syntax suggestion would break existing code for class destructors. Perhaps the syntax should be different. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4409] to!double(-nan) throws
http://d.puremagic.com/issues/show_bug.cgi?id=4409 David Simcha dsim...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #1 from David Simcha dsim...@yahoo.com 2010-08-11 13:58:44 PDT --- This appears to have been fixed in 2.048. Must be related to the revamp of std.conv. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2866] Can't declare static struct inside function scope
http://d.puremagic.com/issues/show_bug.cgi?id=2866 David Simcha dsim...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #1 from David Simcha dsim...@yahoo.com 2010-08-11 14:12:17 PDT --- This appears to have been fixed at some point in the past. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2306] Scope for dynamic arrays should free memory.
http://d.puremagic.com/issues/show_bug.cgi?id=2306 David Simcha dsim...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||WONTFIX --- Comment #7 from David Simcha dsim...@yahoo.com 2010-08-11 14:16:06 PDT --- I'm closing this since we're doing away with scope classes and moving them to a library solution. The corresponding library solution for arrays is std.container.Array. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2306] Scope for dynamic arrays should free memory.
http://d.puremagic.com/issues/show_bug.cgi?id=2306 nfx...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED CC||nfx...@gmail.com Version|2.018 |D1 Resolution|WONTFIX | OS/Version|Windows |All Severity|minor |enhancement --- Comment #8 from nfx...@gmail.com 2010-08-11 14:25:52 PDT --- Still valid for D1. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4605] Wrong print of an int[string] aa
http://d.puremagic.com/issues/show_bug.cgi?id=4605 --- Comment #1 from bearophile_h...@eml.cc 2010-08-11 14:52:18 PDT --- This D2 code: import std.stdio; void main() { int[int[int]] aa; aa[[5:6, 7:8]] = 2; writeln(aa); } gives the useless output: 5:6 7:8:2 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2306] Scope for dynamic arrays should free memory.
http://d.puremagic.com/issues/show_bug.cgi?id=2306 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #9 from bearophile_h...@eml.cc 2010-08-11 14:52:54 PDT --- I think D1 is feature-frozen, I don't think this will be ever added by Walter. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2306] Scope for dynamic arrays should free memory.
http://d.puremagic.com/issues/show_bug.cgi?id=2306 Leandro Lucarella llu...@gmail.com changed: What|Removed |Added CC||llu...@gmail.com --- Comment #10 from Leandro Lucarella llu...@gmail.com 2010-08-11 15:13:28 PDT --- (In reply to comment #9) I think D1 is feature-frozen, I don't think this will be ever added by Walter. But this is not a feature request, is a bug report. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4625] New: in operator for AAs in SafeD code
http://d.puremagic.com/issues/show_bug.cgi?id=4625 Summary: in operator for AAs in SafeD code Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: druntime AssignedTo: s...@invisibleduck.org ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-08-11 15:19:01 PDT --- This comes after a short discussion in D.learn, where simendsjo in D.learn has shown few examples. I presume in done on an Associative Array currently returns a pointer to remove dual AA lookup in a common situation: auto ptr = x in aa; if (ptr) { // do something with *ptr } else { // do something else } But this code shows that it's hard to accept in SafeD the currently designed in operator for associative arrays: void main() { auto aa = [1 : 2]; auto p1 = 1 in aa; aa.rehash; // p1 invalidated by rehashing auto p2 = 1 in aa; aa.remove(1); // p2 invalidated by removal } On the other hand x in AA is a basic operation that I need to perform in SafeD code too. I can see two possible solutions, but I like only the second one: 1) This first solutions needs two changes at the same time: - in done on associative arrays always returns a bool, this is memory safe. - improve the optimizer part of the compiler so it is able to remove most cases of dual lookups in AAs. If the compiler is naive then code like this: if (x in aa) { auto value = aa[x]; // ... } requires two searches inside the hash, the first to tell if the key is present, and the second to find it again and fetch its value. A better compiler (LDC1 is already able to do this) can recognize that the code is performing two nearby key searches with the same key, and it can remove the second one, essentially replacing that code with this one: auto __tmp = x in aa; if (__tmp) { auto value = *__tmp; // ... } If the key is removed or a rehash is performed, the compiler doesn't perform that optimization. This is good in theory, but in practice sometimes there is some distance between the first and second lookup, so I think sometimes the compiler may not be able to optimize away the second lookup. 2) So I prefer a second solution that has less demands on the optimizer: - Add to AAs a contains() method that always return a boolean. - In SafeD code Disallow the in operator for AAs. So in SafeD code you can use aa.contains(). - Improve the optimizer a bit so it's able to remove some cases of dual lookups in AAs (both in SafeD and non SafeD code). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2306] Scope for dynamic arrays should free memory.
http://d.puremagic.com/issues/show_bug.cgi?id=2306 --- Comment #11 from nfx...@gmail.com 2010-08-11 15:21:37 PDT --- Nobody knows whether this is a bug report or an enhancement request because D1 is too underspecified. Walter has added features to D1 in the past, although I suspect he's keeping that low to advertise D2. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4626] New: undefined identifier causes assertion failure in statements.c
http://d.puremagic.com/issues/show_bug.cgi?id=4626 Summary: undefined identifier causes assertion failure in statements.c Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: minor Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: kulhane...@wright.edu --- Comment #0 from Ray Kulhanek kulhane...@wright.edu 2010-08-11 17:17:43 PDT --- void main() { foreach(i; 0..s.length) {} } --- When compiling the above code with dmd 2.047 on Windows XP SP3, I get the following error: test.d(2): Error: undefined identifier s Assertion failure: '0' on line 2237 in 'statement.c' Testing it on Windows 98 with dmd 2.036 didn't yield this error (It caught the undefined identifier, but didn't fail an assert.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4564] ICE on undefined variable in foreach over 0 .. undef
http://d.puremagic.com/issues/show_bug.cgi?id=4564 Brad Roberts bra...@puremagic.com changed: What|Removed |Added CC||kulhane...@wright.edu --- Comment #2 from Brad Roberts bra...@puremagic.com 2010-08-11 17:29:32 PDT --- *** Issue 4626 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 4626] undefined identifier causes assertion failure in statements.c
http://d.puremagic.com/issues/show_bug.cgi?id=4626 Brad Roberts bra...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED CC||bra...@puremagic.com Resolution||DUPLICATE --- Comment #1 from Brad Roberts bra...@puremagic.com 2010-08-11 17:29:32 PDT --- *** This issue has been marked as a duplicate of issue 4564 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4627] New: Ideas for std.regex.match usage syntax
http://d.puremagic.com/issues/show_bug.cgi?id=4627 Summary: Ideas for std.regex.match usage syntax 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 2010-08-11 19:21:18 PDT --- Ideas for possible changes in std.regex.match() user interface, mostly to shorten it, but also to make it simpler to use. This is what you currently ned to use to iterate on matches: stringtext = ...; foreach (m; match(text, regex(r\d)).captures) { ... } The regex() there is useful because you can add attributes like g as second argument, but often I don't need attributes, while often I may appreciate a shorter syntax (even if I don't need a built-in regex syntax as in Ruby and Perl). So match() can accept as second argument both an engine (regex) or a string, when attributes are not necessary: foreach (m; match(text, r\d).captures) { ... } Another possible idea to shorten the syntax is to make match() iterable (I don't know if this is possible or if it is a good idea), this also makes it simpler to use (no need to know about 'captures'): foreach (m; match(text, r\d)) { ... } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4628] New: Casting away const should be allowed in safe mode if no indirection
http://d.puremagic.com/issues/show_bug.cgi?id=4628 Summary: Casting away const should be allowed in safe mode if no indirection 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 2010-08-11 19:36:45 PDT --- void fun() @safe { const uint foo = 2; uint bar = foo; // Works. auto bar = cast(uint) foo; // Doesn't work; } test9.d(4): Error: cast from const(uint) to uint not allowed in safe code test9.d(4): Error: declaration test9.fun.bar is already defined -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4629] New: BufferedFile.printf() wants char[] as first argument
http://d.puremagic.com/issues/show_bug.cgi?id=4629 Summary: BufferedFile.printf() wants char[] as first argument Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-08-11 19:38:30 PDT --- Using dmd 2.048 on this code: import std.stream: BufferedFile, FileMode; void main() { auto f = new BufferedFile(testfile.t, FileMode.Out); f.printf(%d\n, 10); f.close(); } It shows the errors: test.d(4): Error: function std.stream.Stream.printf (char[] format,...) is not callable using argument types (string,int) test.d(4): Error: cannot implicitly convert expression (%d\x0a) of type string to char[] This gives no errors: f.printf(cast(char[])%d\n, 10); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4455] Taking the sqrt of an integer shouldn't require an explicit cast.
http://d.puremagic.com/issues/show_bug.cgi?id=4455 David Simcha dsim...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #2 from David Simcha dsim...@yahoo.com 2010-08-11 19:45:25 PDT --- Fixed SVN. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---