Bug 23477 – std.stdio.readln is @system, and cannot be used from @safe code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-11T19:40:14Z
Last change time
2022-12-06T18:16:16Z
Keywords
safe
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2022-11-11T19:40:14Z
Reported by Siarhei Siamashka: @safe: import std.stdio; void main() { readln; } $ dmd test.d test.d(3): Error: `@safe` function `D main` cannot call `@system` function `std.stdio.readln!string.readln` /usr/lib/dmd/2.099/import/std/stdio.d(4566): `std.stdio.readln!string.readln` is declared here
Comment #1 by nick — 2022-11-16T10:07:31Z
Make std.stdio.File.readln @safe: https://github.com/dlang/phobos/pull/8623
Comment #2 by dkorpel — 2022-12-06T18:16:16Z
Fixed by Nick's PR