Bug 18448 – Make std.file.write / std.stdio.write conflicts more tractable for beginners

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2018-02-16T02:44:47Z
Last change time
2024-12-01T16:32:43Z
Assigned to
No Owner
Creator
Seb
Moved to GitHub: phobos#10310 →

Comments

Comment #0 by greensunny12 — 2018-02-16T02:44:47Z
It's a common gotcha for newcomers that std.file.write and std.stdio.write conflict with each other when used. Of course, this can be trivially resolved with various of tricks (selective imports, renamed imports, static imports etc.), but with the upcoming std.experimental.scripting package (and eventually `import std`), this problem will occur more and more to newcomers. However, I'm not sure on a good way to proceed here. std.file.write is too popularly used to be deprecated, but I put this into the issue tracker because I think this will pop up more and more. If there's no actionable, at least the documentation should be improved. It's rather short at the moment [1]. Heck this is such a popular problem that we even could think to include a special error message into the compiler ... See also: 12368 https://github.com/dlang/phobos/pull/2011 https://dlang.org/phobos/std_stdio.html#.toFile [1] https://dlang.org/phobos/std_file.html#.write
Comment #1 by tiberiulepadatu14 — 2018-10-21T17:59:26Z
Can you please suggest a solution? The current error message seems self explanatory to me std.stdio.write!(string, string).write at ~/dlang/dmd/generated/linux/release/64/../../../../../phobos/std/stdio.d(3729) conflicts with std.file.write!string.write at ~/dlang/dmd/generated/linux/release/64/../../../../../phobos/std/file.d(735)
Comment #2 by greeenify — 2018-10-21T18:06:02Z
1) deprecate 2) improve the error message 3) improve the documentation
Comment #3 by robert.schadek — 2024-12-01T16:32:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10310 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB