www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5724] New: web example of BufferedFile has compile error

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5724

           Summary: web example of BufferedFile has compile error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: rinick gmail.com



http://www.digitalmars.com/d/2.0/phobos/std_stream.html

  Stream file = new BufferedFile("sample.txt");
  foreach(ulong n, string line; file) {
     stdout.writefln("line %d: %s",n,line);
  }

Error: function std.stream.Stream.opApply (scope int delegate(ref cha
r[]) dg) is not callable using argument types (int delegate(ref ulong
__applyArg
0, ref string __applyArg1))
Error: cannot implicitly convert expression (__foreachbody1239) of ty
pe int delegate(ref ulong __applyArg0, ref string __applyArg1) to int
delegate(r
ef ulong n, ref wchar[] line)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 09 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5724


ZY Zhou <rinick gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



I found it's already reported, 3 years ago.
Can't believe the example is still not fixed.

*** This issue has been marked as a duplicate of issue 2114 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 09 2011