void test @safe
{
import std.array;
struct S
{
void opAssign(S)
{
}
}
auto a1 = Appender!(const(S)[])();
auto s1 = const(S)();
a1.put(s1);
}
onlineapp.d(14): Error: @safe function 'onlineapp.test' cannot call @system function 'std.array.Appender!(const(S)[]).Appender.put!(const(S)).put'
Comment #1 by greensunny12 — 2018-01-03T03:15:30Z
Another example:
void test @safe {
static class A {}
auto w = appender!(shared(A)[])();
w.put(new shared A());
}
Comment #2 by Ajieskola — 2021-11-01T17:12:44Z
Both of these examples compile with self-built DMD v2.098.0-132-ge26dfa84d, after adding function parenthesis and an import to the latter example. Both still failed with DMD v2.095.1. Assuming fixed.