[Issue 22289] New: Can't `std.algorithm.mutation: copy` a `scope` string into an an `Appender` with DIP1000
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 8 01:50:30 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22289
Issue ID: 22289
Summary: Can't `std.algorithm.mutation: copy` a `scope` string
into an an `Appender` with DIP1000
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: industry, safe
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: pro.mathias.lang at gmail.com
```
import std.algorithm.mutation : copy;
import std.array : Appender;
void issueXXX (scope const char[] data) @safe
{
Appender!string buffer;
copy(data, buffer);
}
```
Expected: Compiles
Actual result when compiled with `-preview=dip1000`:
```
onlineapp.d(7): Error: scope variable `data` assigned to non-scope parameter
`source` calling std.algorithm.mutation.copy!(const(char)[],
Appender!string).copy
```
This affects https://github.com/dlang-community/D-YAML
--
More information about the Digitalmars-d-bugs
mailing list