digitalmars.D.learn - std.range.chain bug?
- Jack Applegame (9/9) Nov 25 2013 This isn't compiles. Bug?
- Jack Applegame (1/1) Nov 25 2013 *doesn't compile
- monarch_dodra (2/3) Nov 25 2013 Yes, and a trivially trivial bug at that. File it and I'll fix it.
- Jack Applegame (2/4) Nov 26 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11607
- Jesse Phillips (3/12) Nov 25 2013 Seems like a bug to me. If Foo where a string I'd expect it to
- monarch_dodra (2/17) Nov 25 2013 Really? Why? As a matter of fact, it *works* with string...
- Jonathan M Davis (4/26) Nov 25 2013 What works with string? chain(a, b).length had better not work if either...
- monarch_dodra (10/39) Nov 25 2013 Right, but he said "Foo":
- Jesse Phillips (3/11) Nov 26 2013 Yes, my mistake, array of string should be fine. I was trying to
This isn't compiles. Bug? import std.range; class Foo {} void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; } http://dpaste.dzfl.pl/71272a10
Nov 25 2013
On Monday, 25 November 2013 at 19:38:44 UTC, Jack Applegame wrote:This isn't compiles. Bug?Yes, and a trivially trivial bug at that. File it and I'll fix it.
Nov 25 2013
On Monday, 25 November 2013 at 20:54:21 UTC, monarch_dodra wrote:Yes, and a trivially trivial bug at that. File it and I'll fix it.https://d.puremagic.com/issues/show_bug.cgi?id=11607
Nov 26 2013
On Monday, 25 November 2013 at 19:38:44 UTC, Jack Applegame wrote:This isn't compiles. Bug? import std.range; class Foo {} void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; } http://dpaste.dzfl.pl/71272a10Seems like a bug to me. If Foo where a string I'd expect it to fail, but what you have looks reasonable.
Nov 25 2013
On Monday, 25 November 2013 at 21:04:43 UTC, Jesse Phillips wrote:On Monday, 25 November 2013 at 19:38:44 UTC, Jack Applegame wrote:Really? Why? As a matter of fact, it *works* with string...This isn't compiles. Bug? import std.range; class Foo {} void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; } http://dpaste.dzfl.pl/71272a10Seems like a bug to me. If Foo where a string I'd expect it to fail, but what you have looks reasonable.
Nov 25 2013
On Monday, November 25, 2013 22:08:37 monarch_dodra wrote:On Monday, 25 November 2013 at 21:04:43 UTC, Jesse Phillips wrote:What works with string? chain(a, b).length had better not work if either a or b is a string, because hasLength is false for narrow strings. - Jonathan M DavisOn Monday, 25 November 2013 at 19:38:44 UTC, Jack Applegame wrote:Really? Why? As a matter of fact, it *works* with string...This isn't compiles. Bug? import std.range; class Foo {} void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; } http://dpaste.dzfl.pl/71272a10Seems like a bug to me. If Foo where a string I'd expect it to fail, but what you have looks reasonable.
Nov 25 2013
On Monday, 25 November 2013 at 23:44:26 UTC, Jonathan M Davis wrote:On Monday, November 25, 2013 22:08:37 monarch_dodra wrote:Right, but he said "Foo": import std.range; alias Foo = string; void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; }On Monday, 25 November 2013 at 21:04:43 UTC, Jesse Phillips wrote:What works with string? chain(a, b).length had better not work if either a or b is a string, because hasLength is false for narrow strings. - Jonathan M DavisOn Monday, 25 November 2013 at 19:38:44 UTC, Jack Applegame wrote:Really? Why? As a matter of fact, it *works* with string...This isn't compiles. Bug? import std.range; class Foo {} void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; } http://dpaste.dzfl.pl/71272a10Seems like a bug to me. If Foo where a string I'd expect it to fail, but what you have looks reasonable.
Nov 25 2013
On Tuesday, 26 November 2013 at 06:55:40 UTC, monarch_dodra wrote:Right, but he said "Foo": import std.range; alias Foo = string; void main() { immutable(Foo)[] a; immutable(Foo)[] b; auto c = chain(a, b).length; }Yes, my mistake, array of string should be fine. I was trying to think of a situation it shouldn't work, identified it wrong.
Nov 26 2013