...except for templated functions:

int[] escape(scope int[] r)
{
    return r; //error, can't return scoped argument
}

int[] escape(return int[] r)
{
    return r; //ok, just as planned
}

int[] escape(return scope int[] r)
{
    return r; //ok, `return scope` reduced to just `return`
}

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?

Reply via email to