[Issue 9749] typeof(return) is sometimes disallowed for inner functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 19 11:23:36 PDT 2013


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



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-19 11:23:35 PDT ---
(In reply to comment #2)
> Thank you for your patch Andrej.
> 
> Don, from the GitHub thread:
> 
> > The enhancement request seems a bit doubtful to me, doesn't it cause confusion?
> 
> I kind of agree with Don here... Bargaining a little convenience with some
> potential confusion isn't so good in a programming language.
> 
> Do you want me to close this ER down?

We could rename it to allow these cases which are currently disallowed:

// ok, infer from return type
int a(typeof(return) intVar)
{
    return 1;
}

// ok, infer from return expression
auto b(typeof(return) intVar)
{
    return 1;
}

-- 
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