[Issue 10138] Regression (2.063 git-head): Using ReturnType with scoped no longer works

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 27 14:51:42 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10138



--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-05-27 14:51:41 PDT ---
(In reply to comment #2)
> In fact, the type you had extract by using ReturnType!(scoped!A) had not been
> correct scoped value type. The bug has fixed by phobos/pull/1215, therefore the
> OP code is invalid right now.
> 
> In conclusion, this is not a regression.

Here's the thing, though. In that phobos pull, monarchdodra commented with:

"Finally, I gave Scoped an @disabled this() to prevent our smarter users from
trying to build a Scoped using typeof."

It seems like he is actively trying to *disallow* using either ReturnType or
typeof in order to create a scoped field variable.

But, typeof still works. In 2.063 your example code will become:

-----
class A
{
    this() {}
    this(int) {}
}

class B
{
    typeof(scoped!A()) a;

    this()
    {
        a = scoped!A();   // ok
        a = scoped!A(1);  // ok
    }
}
-----

So now I can't tell whether we *support* using scoped field variables or is the
above just a hack? I need to know what to put in the changelog.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list