From the newsgroup: https://forum.dlang.org/post/ooxbnqweqyohygrvspga@forum.dlang.org ```D // REQUIRED_ARGS: -preview=dip1000 @safe: struct B() { int* a; C!() c; } class C() { C!() foo(int* a) { return foo2(a); } C!() foo2(int* a) { auto b = B!()(a); return b.c; } } void main() { scope int* a; C!() c; // Error: scope variable `a` assigned to non-scope parameter `a` calling `foo` c.foo(a); } a); } ```
Do we really want `scope` inference on virtual methods? The code type checks without deprecation if you mark both methods as `final`.
If inferring `return scope` on `a` was not the intention, can you maybe clarify how a fix for this issue would work?
(In reply to timon.gehr from comment #1) > Do we really want `scope` inference on virtual methods? Good point, I missed that the method is virtual. I think this would be invalid then. (Though of course the enhancement for separate lifetimes for separate aggregate fields still stands)