www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23477] New: std.stdio.readln is system, and cannot be used

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 puremagic.com
          Reporter: bugzilla 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

--
Nov 11 2022