Bug 3095 – wc example for D2 doesn't compile

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-06-26T00:41:00Z
Last change time
2015-06-09T01:18:04Z
Assigned to
nobody
Creator
daniel.keep+d.puremagic.com

Attachments

IDFilenameSummaryContent-TypeSize
404bug-3095.patchPatchtext/plain817

Comments

Comment #0 by daniel.keep+d.puremagic.com — 2009-06-26T00:41:49Z
Attempting to compile the example program given at http://digitalmars.com/d/2.0/wc.html results in the following: irc.d(54): Error: constructor std.stream.BufferedFile.this () does not match parameter types (char[]) irc.d(54): Error: cannot implicitly convert expression (arg) of type char[] to HANDLE irc.d(54): Error: expected 3 function arguments, not 1 This appears to be because the ctor that accepts a filename wants a string, not a char[], but the compiler is trying to match it to the ctor that takes a HANDLE. Replacing all instances of char[] with string appears to fix the problem as well as being idiomatic D2.
Comment #1 by daniel.keep+d.puremagic.com — 2009-06-26T07:14:41Z
Created attachment 404 Patch
Comment #2 by daniel.keep+d.puremagic.com — 2009-06-26T07:15:11Z
Comment on attachment 404 Patch Fixes issue
Comment #3 by bugzilla — 2009-07-09T02:57:45Z
Fixed dmd 2.031