@safe:
class Foo
{
@safe:
ubyte[] bytes()
{
return new ubyte[1];
}
}
ubyte[] getBytes()
{
scope foo = new Foo();
return foo.bytes(); // Error: scope variable foo assigned to non-scope parameter this calling Foo.bytes
}
void main()
{
auto v = getBytes();
}