[Issue 9155] New: Ddoc: code section should strip leading spaces
http://d.puremagic.com/issues/show_bug.cgi?id=9155 Summary: Ddoc: code section should strip leading spaces Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: ddoc Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: k.hara...@gmail.com --- Comment #0 from Kenji Hara 2012-12-13 23:52:28 PST --- In current, ddoc does not strip leading spaces in code section. This code: === /** * Example: * --- * import std.stdio; * writeln("Hello world!"); * if (test) { *writefln("D programming language"); * } * --- */ void foo(){} === Outputs: === void foo(); Example: import std.stdio; writeln("Hello world!"); if (test) { writefln("D programming language"); } === Should be: === void foo(); Example: import std.stdio; writeln("Hello world!"); if (test) { writefln("D programming language"); } === -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9037] DDoc: Chokes on consecutive example sections:
http://d.puremagic.com/issues/show_bug.cgi?id=9037 Kenji Hara changed: What|Removed |Added Keywords||pull, rejects-valid --- Comment #1 from Kenji Hara 2012-12-13 23:38:24 PST --- https://github.com/D-Programming-Language/dmd/pull/1376 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7459] working around nested function declaration order
http://d.puremagic.com/issues/show_bug.cgi?id=7459 --- Comment #1 from hst...@quickfur.ath.cx 2012-12-13 22:29:06 PST --- Ideally, the compiler should allow nested functions to call each other. I understand there are some complications with how declarations inside function scope are processed, but is there a way to treat function declarations differently from variable declarations? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9151] opCast makes "this" alias ineffective
http://d.puremagic.com/issues/show_bug.cgi?id=9151 --- Comment #3 from Puneet Goel 2012-12-13 22:19:47 PST --- Kenji, thanks for clarification. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9151] opCast makes "this" alias ineffective
http://d.puremagic.com/issues/show_bug.cgi?id=9151 --- Comment #2 from Kenji Hara 2012-12-13 22:16:00 PST --- (In reply to comment #0) > The following code gives me an error saying: > Error: template instance opCast!(bool) opCast!(bool) does not match template > declaration opCast(T)() if (is(T == int)) (In reply to comment #0) > The following code gives me an error saying: > Error: template instance opCast!(bool) opCast!(bool) does not match template > declaration opCast(T)() if (is(T == int)) This is an intended behavior. 1. In IfStatement, opCast!bool is implicitly used. http://dlang.org/operatoroverloading#Cast 2. alias this works just like a class inheritance. If the derived type (== Foo) defines opCast, compiler does not look up the base type opCast (== implicit conversion from int to bool) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9154] Incorrectly generated assignment operator
http://d.puremagic.com/issues/show_bug.cgi?id=9154 Kenji Hara changed: What|Removed |Added Keywords||pull, rejects-valid --- Comment #3 from Kenji Hara 2012-12-13 21:04:27 PST --- https://github.com/D-Programming-Language/dmd/pull/1375 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9154] Incorrectly generated assignment operator
http://d.puremagic.com/issues/show_bug.cgi?id=9154 --- Comment #2 from Kenji Hara 2012-12-13 21:02:05 PST --- (In reply to comment #1) > The compiler should act mechanically here: the generated assignment for T > should simply perform a field-by-field assignment without nitpicking. OK. When I organized "identity assignable" concept, I had lacked it in my fix (mainly dmd pull #166). - Even if user defines an opAssign which receives only lvalue, compiler should treat it as identity opAssign. This is satisfied the condition for field-by-field assignment. Then, S is treated as an "identity assignable" struct, and built-in opAssign generating in T will succeed correctly. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9154] Incorrectly generated assignment operator
http://d.puremagic.com/issues/show_bug.cgi?id=9154 --- Comment #1 from Andrei Alexandrescu 2012-12-13 19:57:18 PST --- Consider: struct S { int x; void opAssign(ref S s) { } } struct T { S member; } void main() { T t1, t2; t1 = t2; } This fails to compile with the error: Error: cannot modify struct t1 T with immutable members The error is caused by the "ref" in the definition of opAssign. Replacing "ref" with "ref const" or "ref immutable" doesn't help, either. The compiler should act mechanically here: the generated assignment for T should simply perform a field-by-field assignment without nitpicking. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9154] New: Incorrectly generated assignment operator
http://d.puremagic.com/issues/show_bug.cgi?id=9154 Summary: Incorrectly generated assignment operator Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: and...@metalanguage.com --- Comment #0 from Andrei Alexandrescu 2012-12-13 19:53:51 PST --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9153] Type inference for array of delegates should not break based on order
http://d.puremagic.com/issues/show_bug.cgi?id=9153 Kenji Hara changed: What|Removed |Added Keywords||pull, rejects-valid --- Comment #1 from Kenji Hara 2012-12-13 19:22:03 PST --- https://github.com/D-Programming-Language/dmd/pull/1374 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9141] (D1 only) Incorrect "more initializers than fields" error
http://d.puremagic.com/issues/show_bug.cgi?id=9141 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 9141] (D1 only) Incorrect "more initializers than fields" error
http://d.puremagic.com/issues/show_bug.cgi?id=9141 --- Comment #1 from github-bugzi...@puremagic.com 2012-12-13 13:03:52 PST --- Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5698e335af11af8b3ec589b45dddbc7742e1f587 fix Issue 9141 - (D1 only) Incorrect 'more initializers than fields' error -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4584] std.algorithm.sort fails with SwapStrategy.stable
http://d.puremagic.com/issues/show_bug.cgi?id=4584 Dmitry Olshansky changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #9 from Dmitry Olshansky 2012-12-13 12:32:45 PST --- Strangely it didn't pick up commits. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9153] New: Type inference for array of delegates should not break based on order
http://d.puremagic.com/issues/show_bug.cgi?id=9153 Summary: Type inference for array of delegates should not break based on order Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: hst...@quickfur.ath.cx --- Comment #0 from hst...@quickfur.ath.cx 2012-12-13 10:23:50 PST --- import std.stdio; version=Broken; void main() { version(Broken) { auto tbl = [ (string x) { writeln(x); }, (string x) { x ~= 'a'; }, ]; } else { auto tbl = [ (string x) { x ~= 'a'; }, (string x) { writeln(x); }, ]; } } This code used to compile in dmd 2.058. Commenting out "version=Broken" fixes the problem. It seems that type inference isn't being done correctly for the delegates in the array, depending on what order they appear in. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 8348] ICE(glue.c): 'semanticRun == PASSsemantic3done' on line 547 in file 'glue.c'
http://d.puremagic.com/issues/show_bug.cgi?id=8348 --- Comment #15 from Dmitry Olshansky 2012-12-13 10:12:42 PST --- (In reply to comment #13) > Ok, here's the trouble. A postblit is generated for copying elements of the > associated array, but the postblit fails to compile because postblit doesn't > work on const arguments. > Now this highlights a bigger problem as AFAIK AA keys bascially supposed to be immutable... Anyway good to see that ICE gone. >Unfortunately, the error message was lost, so I "fixed" it by putting out a > generic message, >druntime\import\object.di(396): Error: function >object.AssociativeArray!(const(Set!(uint)), >int).AssociativeArray.Slot.__fieldPostBlit errors compiling the function Well, line number is a start. I'll file a diagnostic bug then as user really shouldn't see this mess. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9152] Regression in type inference of array of delegates
http://d.puremagic.com/issues/show_bug.cgi?id=9152 hst...@quickfur.ath.cx changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from hst...@quickfur.ath.cx 2012-12-13 10:00:13 PST --- Oops, the code snippet is wrong. I'll have to reduce the actual failing code again and file another bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9084] Structs assignment and associative arrays
http://d.puremagic.com/issues/show_bug.cgi?id=9084 Maxim Fomin changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE --- Comment #1 from Maxim Fomin 2012-12-13 09:59:34 PST --- *** This issue has been marked as a duplicate of issue 6178 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6178] Struct inside the AA are not init correctly
http://d.puremagic.com/issues/show_bug.cgi?id=6178 Maxim Fomin changed: What|Removed |Added CC||ma...@maxim-fomin.ru --- Comment #10 from Maxim Fomin 2012-12-13 09:59:34 PST --- *** Issue 9084 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 9152] New: Regression in type inference of array of delegates
http://d.puremagic.com/issues/show_bug.cgi?id=9152 Summary: Regression in type inference of array of delegates Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: hst...@quickfur.ath.cx --- Comment #0 from hst...@quickfur.ath.cx 2012-12-13 09:52:16 PST --- This code used to compile in 2.058: alias void delegate(int) DgType; void dispatch(DgType[] funcTable, int idx, int arg) { funcTable[idx](arg); } void main() { dispatch([ (int x) { return x+x; }, (int x) { return x*x; }, (int x) { return x^^2; } ], 0, 1); } Since 2.059, dmd is unable to correctly infer the type of the delegate array literal: test.d(9): Error: function test.dispatch (void delegate(int)[] funcTable, int idx, int arg) is not callable using argument types (int function(int x) pure nothrow @safe[],int,int) test.d(9): Error: cannot implicitly convert expression ([delegate pure nothrow @safe int(int x) { return x + x; } , delegate pure nothrow @safe int(int x) { return x * x; } , delegate pure nothrow @safe int(int x) { return int __powtmp8 = x; , __powtmp8 * __powtmp8; } ]) of type int function(int x) pure nothrow @safe[] to void delegate(int)[] In this case, one can add @safe to the alias as a workaround, but it doesn't work if the same function needs to be called with another array that contains a @system delegate. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9151] opCast makes "this" alias ineffective
http://d.puremagic.com/issues/show_bug.cgi?id=9151 --- Comment #1 from Puneet Goel 2012-12-13 09:48:46 PST --- Also note that if both "this" alias and opCast to bool are present, the "this" alias is getting ignored in favor of opCast -- though I am not using explicit cast operation. struct Foo { int t; bool get() { return (t == 0); } alias get this; T opCast(T) () if(is(T == int)) { return t; } T opCast(T) () if(is(T == bool)) { import std.stdio; writeln("I am here"); return (t != 0); } } void main() { Foo f; if(f) {} } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6178] Struct inside the AA are not init correctly
http://d.puremagic.com/issues/show_bug.cgi?id=6178 --- Comment #9 from Don 2012-12-13 09:35:46 PST --- On Linux, I see the bug only with 32 bits, it works OK with 64 bits. With -m64 and -m64 -O, I get 0 opAssign called 1 dtor called 0 dtor called whereas with -m32 I get -142997715 opAssign called 1 dtor called -142997715 dtor called and with -m32 -O 2 opAssign called 1 dtor called 2 dtor called -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9151] New: opCast makes "this" alias ineffective
http://d.puremagic.com/issues/show_bug.cgi?id=9151 Summary: opCast makes "this" alias ineffective Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: pun...@coverify.org --- Comment #0 from Puneet Goel 2012-12-13 09:34:14 PST --- The following code gives me an error saying: Error: template instance opCast!(bool) opCast!(bool) does not match template declaration opCast(T)() if (is(T == int)) The error disappears if the opCast is not defined. struct Foo { int t; bool get() { return (t == 0); } alias get this; T opCast(T) () if(is(T == int)) { return t; } } void main() { Foo f; if(f) {} } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4489] std.array.insert is slow
http://d.puremagic.com/issues/show_bug.cgi?id=4489 Dmitry Olshansky changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #9 from Dmitry Olshansky 2012-12-13 09:23:17 PST --- (In reply to comment #8) > Commit pushed to master at https://github.com/D-Programming-Language/phobos > > https://github.com/D-Programming-Language/phobos/commit/14e457b37d0a870a8ed7dd901e10679456edc6b3 > fix issue 4489 std.array.insert is slow With latest master and compile options: -noboundscheck -O -inline -release I see no measurable difference in inserting at front or end as it should have been. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 8900] Using zip with char[] sometimes fails to compile
http://d.puremagic.com/issues/show_bug.cgi?id=8900 --- Comment #6 from github-bugzi...@puremagic.com 2012-12-13 09:00:22 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a00c3c825c863c0c53cb69ab907c7be539bf51e4 Fix bug 8900 - Zip with infinite range fails. `std.range.Zip` contains a `Tuple`, whose `toString()` function calls `formatElement` which eventually calls this function, leading to a static call to `walkLength` on infinite ranges. Since pul request 880, `walkLength` doesn't work with infinite ranges, so it fails to compile. This change ensures that `walkLength` is called with only valid range types. Bug: http://d.puremagic.com/issues/show_bug.cgi?id=8900 https://github.com/D-Programming-Language/phobos/commit/259cd23d67b8025eebc5c46e3756e2c98337a663 Merge pull request #901 from Poita/bug8900 Fix bug 8900 - Zip with infinite char range fails. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4489] std.array.insert is slow
http://d.puremagic.com/issues/show_bug.cgi?id=4489 --- Comment #8 from github-bugzi...@puremagic.com 2012-12-13 08:53:24 PST --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/14e457b37d0a870a8ed7dd901e10679456edc6b3 fix issue 4489 std.array.insert is slow -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9150] Mismatching static array length should be detected in foreach
http://d.puremagic.com/issues/show_bug.cgi?id=9150 Kenji Hara 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 6883] Array static bounds tests with $ too
http://d.puremagic.com/issues/show_bug.cgi?id=6883 Kenji Hara 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 9150] Mismatching static array length should be detected in foreach
http://d.puremagic.com/issues/show_bug.cgi?id=9150 --- Comment #2 from github-bugzi...@puremagic.com 2012-12-13 08:43:30 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3f5912d00ab1a81c5c47140026a5dd483840f825 fix Issue 9150 - Mismatching static array length should be detected in foreach https://github.com/D-Programming-Language/dmd/commit/71460c1b20c41c1fc7282fb8832acf43d5a2976c Merge pull request #1373 from 9rnsr/fix9150 Issue 9150 - Mismatching static array length should be detected in foreach -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9150] Mismatching static array length should be detected in foreach
http://d.puremagic.com/issues/show_bug.cgi?id=9150 Kenji Hara changed: What|Removed |Added Keywords||accepts-invalid, pull --- Comment #1 from Kenji Hara 2012-12-13 08:07:14 PST --- https://github.com/D-Programming-Language/dmd/pull/1373 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9150] New: Mismatching static array length should be detected in foreach
http://d.puremagic.com/issues/show_bug.cgi?id=9150 Summary: Mismatching static array length should be detected in foreach Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: k.hara...@gmail.com --- Comment #0 from Kenji Hara 2012-12-13 07:21:19 PST --- >From the forum discussion: http://forum.dlang.org/thread/mswgcdhrzcgcjavtq...@forum.dlang.org?page=2#post-gdzjavizncygkbtftpnh:40forum.dlang.org import std.stdio; void main() { int[3][2] matrix = [ [1,11,111], [2,22,222] ]; foreach (int[5] row; matrix) //if int[3], there is no error. { foreach (x; row) write(x, " "); writeln(); } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged
http://d.puremagic.com/issues/show_bug.cgi?id=4269 --- Comment #27 from github-bugzi...@puremagic.com 2012-12-13 06:46:13 PST --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2a1d419a4d87c9a29d3d07f78fc8319ed8a5fc37 Fix bug 4269 case 13:invalid template accepted if evaluated while errors are gagged Need to ungag template declarations if they are forward referenced. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6883] Array static bounds tests with $ too
http://d.puremagic.com/issues/show_bug.cgi?id=6883 --- Comment #4 from github-bugzi...@puremagic.com 2012-12-13 06:45:23 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ca8ddac03a5e04f28290cb4ecac6147de312a582 fix Issue 6883 - Array static bounds tests with $ too https://github.com/D-Programming-Language/dmd/commit/b7443d1e52014ae36a6d556f5c71b14eb3148401 Merge pull request #1372 from 9rnsr/fix6883 Issue 6883 - Array static bounds tests with $ too -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6883] Array static bounds tests with $ too
http://d.puremagic.com/issues/show_bug.cgi?id=6883 Kenji Hara changed: What|Removed |Added Keywords||pull --- Comment #3 from Kenji Hara 2012-12-13 05:52:40 PST --- https://github.com/D-Programming-Language/dmd/pull/1372 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 8902] Unexpected "duplicate union initialization for X" error
http://d.puremagic.com/issues/show_bug.cgi?id=8902 --- Comment #4 from github-bugzi...@puremagic.com 2012-12-13 04:57:44 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/1c54f33603b00163c4736696f2e24587e024327d fixup for Issue 8902 After default initialization, only the first one in overlapped fields is readable in CTFE. https://github.com/D-Programming-Language/phobos/commit/437f15689dae803510321185f3545479dee7c473 Merge pull request #1007 from 9rnsr/fix8902 fixup for Issue 8902 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9149] New: 'const' is broken
http://d.puremagic.com/issues/show_bug.cgi?id=9149 Summary: 'const' is broken Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: timon.g...@gmx.ch --- Comment #0 from timon.g...@gmx.ch 2012-12-13 04:43:47 PST --- Delegates cannot implicitly convert to const without breaking const guarantees. Reading a mutable delegate out of a const reference therefore must be a compile error. (for the same reason a mutable member function cannot be called on a const receiver.) import std.stdio; class T{ int x; int delegate()pure b; this(){ b = ()pure=>x++; } } void main(){ auto s=new T(); const c = s.b; // ok, should fail const t=s; writeln(c(), c(), c(), c()); writeln(t.b(), t.b(), t.b(), t.b()); // ok, should fail } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9148] New: 'pure' is broken
http://d.puremagic.com/issues/show_bug.cgi?id=9148 Summary: 'pure' is broken Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: timon.g...@gmx.ch --- Comment #0 from timon.g...@gmx.ch 2012-12-13 04:38:14 PST --- - There is no way to specify that a delegate is strongly pure without resorting to type deduction, because - Member functions/local functions are handled inconsistently. - Delegate types legally obtained from certain member functions are illegal to declare. - 'pure' means 'weakly pure' for member functions and 'strongly pure' for local functions. Therefore it means 'weakly pure' for delegates, as those can be obtained from both. - Delegates may break the transitivity of immutable, and by extension, shared. A good first step in fixing up immutable/shared would be to make everything that is annotated 'error' pass, and the line annotated 'ok' should fail: import std.stdio; struct S{ int x; int foo()pure{ return x++; } int bar()immutable pure{ // return x++; // error return 2; } } int delegate()pure s(){ int x; int foo()pure{ // return x++; // error return 2; } /+int bar()immutable pure{ // error return 2; }+/ return &foo; } void main(){ S s; int delegate()pure dg = &s.foo; // int delegate()pure immutable dg2 = &s.bar; // error writeln(dg(), dg(), dg(), dg()); // 0123 immutable int delegate()pure dg3 = dg; // ok writeln(dg3(), dg3(), dg3(), dg3()); // 4567 // static assert(is(typeof(cast()dg3)==int delegate() immutable pure)); // error auto bar = &s.bar; pragma(msg, typeof(bar)); // "int delegate() immutable pure" } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9147] New: Implicit conversion to struct with alias this does not work
http://d.puremagic.com/issues/show_bug.cgi?id=9147 Summary: Implicit conversion to struct with alias this does not work Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: simen.kja...@gmail.com --- Comment #0 from Simen Kjaeraas 2012-12-13 03:49:44 PST --- struct bbyte { byte b; alias b this; } void bar(bbyte b) {} bbyte baz() { byte b; return b; // cannot implicitly convert expression (b) of type byte to bbyte } void main() { byte b; bar(b); // function bar (bbyte b) is not callable using argument types (byte) } The above code fails on the marked lines as it's trying to convert the byte to a bbyte. Ref discussion: http://forum.dlang.org/thread/mailman.2599.1355228650.5162.digitalmar...@puremagic.com?page=3#post-mailman.2632.1355345407.5162.digitalmars-d:40puremagic.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6883] Array static bounds tests with $ too
http://d.puremagic.com/issues/show_bug.cgi?id=6883 bearophile_h...@eml.cc changed: What|Removed |Added Severity|enhancement |normal --- Comment #2 from bearophile_h...@eml.cc 2012-12-13 03:10:46 PST --- Instead of an enhancement request this now becomes a bug report, after a discussion with Walter: http://forum.dlang.org/thread/mswgcdhrzcgcjavtq...@forum.dlang.org?page=2#post-kacc35:24coi:241:40digitalmars.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 8715] map, filter, zip with functional arrays/associative arrays
http://d.puremagic.com/issues/show_bug.cgi?id=8715 bearophile_h...@eml.cc changed: What|Removed |Added Summary|zipWith |map, filter, zip with ||functional ||arrays/associative arrays --- Comment #5 from bearophile_h...@eml.cc 2012-12-13 02:53:58 PST --- Another example: import std.stdio: writeln; import std.algorithm: map, filter; void main() { int[] data = [0, 1, 2, 3]; bool[] mask = [true, false, true, false]; int[int] conv = [0:10, 1:20, 2:30, 3:40]; auto r1 = data .filter!(i => mask[i])() .map!(i => conv[i])(); writeln(r1); // Prints: [10, 30] } This is nicer: import std.stdio: writeln; import std.algorithm: map, filter; void main() { int[] data = [0, 1, 2, 3]; bool[] mask = [true, false, true, false]; int[int] conv = [0:10, 1:20, 2:30, 3:40]; auto r2 = data.filter!mask().map!conv(); writeln(r2); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged
http://d.puremagic.com/issues/show_bug.cgi?id=4269 Don changed: What|Removed |Added Keywords||pull --- Comment #26 from Don 2012-12-13 01:05:42 PST --- All test cases now correctly give an error, except for case 13, which is fixed in https://github.com/D-Programming-Language/dmd/pull/1370 There are also diagnostic problems with 3 other test cases, I have created bug 9146 for those. It is much less serious than this bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9146] New: Errors in gagged forward reference declarations are detected too late.
http://d.puremagic.com/issues/show_bug.cgi?id=9146 Summary: Errors in gagged forward reference declarations are detected too late. Product: D Version: D1 & D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: clugd...@yahoo.com.au --- Comment #0 from Don 2012-12-13 01:02:24 PST --- All three of these test cases from bug 4269 correctly generate errors, but the errors occur only in the glue layer. static if(is(typeof(X7))) {} Y7 X7; static if(is(typeof(X11.init))) {} const { Y11 X11; } static if(is(typeof(X12.init))) {} enum X12 = Y12; zoo.d(18): Error: variable zoo.X7 had semantic errors when compiling zoo.d(22): Error: variable zoo.X11 had semantic errors when compiling zoo.d(26): Error: variable zoo.X12 had semantic errors when compiling They should instead give error messages referring to the undefined Y7, Y11, Y12. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---