← Back to index
|
Original Bugzilla link
Bug 8804 – countUntil warning on an infinite range
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-11T14:34:00Z
Last change time
2012-12-16T23:11:49Z
Keywords
diagnostic
Assigned to
monarchdodra
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2012-10-11T14:34:19Z
import std.range: recurrence; import std.algorithm: countUntil; void main() { auto fibs = recurrence!q{a[n-1] + a[n-2]}(1, 1); auto f20 = countUntil!(x => x >= 20)(fibs); } DMD 2.061alpha: ...\algorithm.d(4038): Warning: statement is not reachable
Comment #1
by bearophile_hugs — 2012-10-11T14:34:51Z
Of course it needs to be compiled with warnings on.
Comment #2
by monarchdodra — 2012-10-12T09:34:32Z
(In reply to comment #1) > Of course it needs to be compiled with warnings on. Nice. Compiler is *too* smart! :D I got this one (unless you had it?).
Comment #3
by bearophile_hugs — 2012-10-12T10:52:16Z
(In reply to comment #2) > (unless you had it?). It's all yours. I have not yet started fixing bugs.
Comment #4
by monarchdodra — 2012-12-16T23:11:49Z
https://github.com/D-Programming-Language/phobos/pull/951/files
Fixed and verified by monarchdodra on 17 dec 2012.