Can anyone help me get rid of this depreciation?
struct Foo {
string foo;
string getFoo() const @safe { return foo; }
}
size_t bar(in Foo foo) @safe {
return foo.getFoo().length;
}
void main() {
Foo("hello").bar().writeln();
}
$ ldc2 -preview=in --run foo.d
foo.d(9): Deprecation: scope variable `foo` assigned to non-scope parameter `this` calling `getFoo`
$ ldc2 --version
LDC - the LLVM D compiler (1.32.1):
based on DMD v2.102.2 and LLVM 15.0.7