[Issue 2081] Foreach over Stream appears broken

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 8 15:18:10 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2081


jlquinn at optonline.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal




------- Comment #2 from jlquinn at optonline.net  2008-05-08 17:18 -------
The code becomes:

    foreach (ref string buf; f) {

which the compiler still dislikes:

lexicon.d(92): function std.stream.Stream.opApply (int delegate(ref char[]
line)) does not match parameter types (int delegate(ref invariant(char)[] buf))
lexicon.d(92): Error: cannot implicitly convert expression (__foreachbody15) of
type int delegate(ref invariant(char)[] buf) to int delegate(ref ulong n, ref
wchar[] line)

Changing back to a bug :-)

 BTW, why is "ref" needed?  If so, the docs aren't clear about that and need to
be updated.


-- 



More information about the Digitalmars-d-bugs mailing list