Issue 13681 - @safe empty writeln
Summary: @safe empty writeln
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-04 10:48 UTC by bearophile_hugs
Modified: 2017-07-19 17:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2014-11-04 10:48:16 UTC
void main() @safe {
    import std.stdio: writeln;
    writeln;
}

dmd 2.067alpha gives:

test.d(3,5): Error: safe function 'D main' cannot call system function 'std.stdio.writeln!().writeln'


Note that this compiles:

void main() @safe {
    import std.stdio: write;
    write('\n');
}
Comment 1 github-bugzilla 2015-03-10 21:15:04 UTC
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e601077b8618c595fa51807a85c54f8c4e32ca9a
make 0-arg writeln @trusted: Fix Issue 13681

https://github.com/D-Programming-Language/phobos/commit/38453e82adfdcba8d5d817fd8404acf8edeb04f3
Merge pull request #3046 from John-Colvin/patch-13

make 0-arg writeln @trusted: Fix Issue 13681 take 2
Comment 2 github-bugzilla 2017-07-19 17:42:29 UTC
Commits pushed to dmd-cxx at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/e601077b8618c595fa51807a85c54f8c4e32ca9a
make 0-arg writeln @trusted: Fix Issue 13681

https://github.com/dlang/phobos/commit/38453e82adfdcba8d5d817fd8404acf8edeb04f3
Merge pull request #3046 from John-Colvin/patch-13