[Issue 23477] New: std.stdio.readln is @system, and cannot be used from @safe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 11 19:40:14 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23477

          Issue ID: 23477
           Summary: std.stdio.readln is @system, and cannot be used from
                    @safe code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

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

--


More information about the Digitalmars-d-bugs mailing list