[Issue 6810] New: Strange `tuple used as a type` error
http://d.puremagic.com/issues/show_bug.cgi?id=6810 Summary: Strange `tuple used as a type` error Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: verylonglogin@gmail.com --- Comment #0 from Denis verylonglogin@gmail.com 2011-10-13 02:01:46 PDT --- Strange `tuple used as a type` error if using: template tuple parameter + named argument of its type + an constraint. --- void f(int n)(int) { } void f(U...)(U){ } // ok void f(U...)(U a) { } // ok void f(U...)(U) if(true) { } // ok void f(U...)(U a) if(true) { } // Error: tuple U is used as a type void main() { f!0(0); } --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6811] New: Confusion between string* and immutable(char)*, related to AA's
http://d.puremagic.com/issues/show_bug.cgi?id=6811 Summary: Confusion between string* and immutable(char)*, related to AA's 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 2011-10-13 09:43:59 PDT --- void doExclude(string exclude) { string[string] aa; int[] keep; foreach(int i, h; [a, b]) { auto ptr = h in aa; pragma(msg, typeof(ptr)); // string* pragma(msg, typeof(*ptr)); // string if(*h != exclude) keep ~= i; } } test.d(9): Error: incompatible types for ((*cast(immutable(char)*)h) != (exclude)): 'immutable(char)' and 'string' -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6811] Confusion between string* and immutable(char)*, related to AA's
http://d.puremagic.com/issues/show_bug.cgi?id=6811 David Simcha dsim...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from David Simcha dsim...@yahoo.com 2011-10-13 09:49:30 PDT --- (Slaps self in forehead.) Never mind, I see what I did now. I used *h where I meant *ptr and forgot that strings implicitly convert to char*. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6665] Regression(2.055) ICE(cg87.c): static double inside closure
http://d.puremagic.com/issues/show_bug.cgi?id=6665 David Simcha dsim...@yahoo.com changed: What|Removed |Added CC||dsim...@yahoo.com --- Comment #4 from David Simcha dsim...@yahoo.com 2011-10-13 10:53:08 PDT --- FWIW, I've found another way to reproduce this bug: import std.range, std.algorithm; double fun(double x) { return x; } void main() { map!(fun)(indexed([1.0, 2], [0, 1])); } Using DMD64 on Linux (This is a 64-bit specific issue, adding -m32 makes it go away. It also only happens with -release.) dmd test.d -release Internal error: ../ztc/cg87.c 202 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4124] toString() for BitArray and more
http://d.puremagic.com/issues/show_bug.cgi?id=4124 --- Comment #1 from bearophile_h...@eml.cc 2011-10-13 11:22:06 PDT --- Maybe the usefulness of isSet(), set(), and reset() methods is visible with two benchmarks. They implement the same algorithm (a simple sieve), the first uses a BitArray, and the second a manually implemented bit array. On my 32 bit system the second program is about two times faster than the first one. import std.stdio, std.algorithm, std.range, std.math, std.bitmanip, std.datetime; uint[] primes(uint n) { if (n 2) return []; BitArray F; F.length = n + 1; F[0] = true; F[1] = true; foreach (i; 2 .. cast(uint)sqrt(n)) if (!F[i]) for (uint j = i * i; j = n; j += i) F[j] = true; return array(filter!((i){ return !F[i]; })(iota(n+1))); } void main() { StopWatch sw; sw.start(); primes(30_000_000); sw.stop(); writeln(sw.peek().msecs / 1000.0); } import std.stdio, std.algorithm, std.range, std.math, std.datetime; size_t[] primes(in size_t n) { enum size_t bpc = size_t.sizeof * 8; auto F = new size_t[n / bpc + 1]; F[] = size_t.max; bool isSet(in size_t i) nothrow { immutable size_t offset = i / bpc; immutable size_t mask = 1 (i % bpc); return (F[offset] mask) != 0; } void clear(in size_t i) nothrow { immutable size_t offset = i / bpc; immutable size_t mask = 1 (i % bpc); if ((F[offset] mask) != 0) F[offset] = F[offset] ^ mask; } clear(0); clear(1); foreach (i; 2 .. cast(size_t)sqrt(n)) if (isSet(i)) for (uint j = i * i; j = n; j += i) clear(j); return array(filter!isSet(iota(n + 1))); } void main() { StopWatch sw; sw.start(); size_t n = primes(30_000_000).length; sw.stop(); writeln(sw.peek().msecs / 1000.0); writeln(n primes: , n); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6665] Regression(2.055) ICE(cg87.c): static double inside closure
http://d.puremagic.com/issues/show_bug.cgi?id=6665 --- Comment #5 from David Simcha dsim...@yahoo.com 2011-10-13 11:37:07 PDT --- Even more thoroughly reduced test case: void main() { auto foo = Indexed([1.0f, 2, 3], [1, 2, 3]); } @property ref T front(T)(T[] a) { return a[0]; } struct Indexed { float[] _source; int[] _indices; @property float front(float newVal) { return _source[_indices.front] = newVal; } } $ dmd test.d -release Internal error: ../ztc/cg87.c 202 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6665] Regression(2.055) ICE(cg87.c): static double inside closure
http://d.puremagic.com/issues/show_bug.cgi?id=6665 --- Comment #6 from David Simcha dsim...@yahoo.com 2011-10-13 11:38:40 PDT --- BTW, all this stuff works on the latest GDC, so it's definitely not in any code shared between DMD and GDC. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6812] New: Failed equality of structs with string field
http://d.puremagic.com/issues/show_bug.cgi?id=6812 Summary: Failed equality of structs with string field Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2011-10-13 11:55:44 PDT --- This program produces a runtime assert error, it's a bug: struct Foo { string s; } void main() { Foo b1 = Foo(hello.idup); Foo b2 = Foo(hello.idup); assert(b1 !is b2); // OK assert(b1 == b2); // line 8, error } With DMD 2.056head it gives: core.exception.AssertError@test(8): Assertion failure The equality among structs has to call the string equality of their fields. The is operator has to compare the structs bitwise. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6812] Failed equality of structs with string field
http://d.puremagic.com/issues/show_bug.cgi?id=6812 --- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-10-13 17:53:17 PDT --- Class type has same problem. struct Foo { string s; } struct Bar { static class X { bool opEquals(Object o){ return true; } } X x; } void main() { Foo f1 = Foo(hello.idup); Foo f2 = Foo(hello.idup); assert(f1 !is f2); // OK assert(f1 == f2); // error Bar b1 = Bar(new Bar.X()); Bar b2 = Bar(new Bar.X()); assert(b1 !is b2); // OK assert(b1 == b2); // error! } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2740] Template Mixins do not work as advertised
http://d.puremagic.com/issues/show_bug.cgi?id=2740 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution||FIXED --- Comment #8 from Walter Bright bugzi...@digitalmars.com 2011-10-13 19:40:50 PDT --- https://github.com/D-Programming-Language/dmd/commit/4081225e4407ca08d6c8f9a390e1bb6def057c29 https://github.com/D-Programming-Language/dmd/commit/73e600b38ec0fdcadd3855db4b0ccac53a451da0 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6808] string to BigInt using std.conv.to
http://d.puremagic.com/issues/show_bug.cgi?id=6808 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||patch, rejects-valid Severity|enhancement |normal --- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-10-13 20:00:15 PDT --- https://github.com/D-Programming-Language/phobos/pull/292 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6805] Can't use a type from opDispatch template
http://d.puremagic.com/issues/show_bug.cgi?id=6805 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||patch, rejects-valid Platform|Other |All OS/Version|Windows |All --- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-10-13 22:23:34 PDT --- https://github.com/D-Programming-Language/dmd/pull/447 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---