On Tuesday, 21 August 2018 at 13:42:31 UTC, Kagamin wrote:
int[] escape(scope int[] r)
{
    return r; //error, can't return scoped argument
}
...
int[] escape(T)(scope int[] r)
{
    return r; //ok! `scope` silently promoted to `return`
}

You can't have strictly scoped parameter in a templated function - it's silently promoted to return parameter. Is this intended?

I filed a similar bug (it uses return type inference rather than a template). Walter closed it as invalid:
https://issues.dlang.org/show_bug.cgi?id=17362

Reply via email to