Attribute inference for auto functions?

Timon Gehr timon.gehr at gmx.ch
Fri Apr 19 15:16:39 PDT 2013


On 04/19/2013 09:34 PM, deadalnix wrote:
> On Friday, 19 April 2013 at 19:06:39 UTC, Walter Bright wrote:
>> On 4/19/2013 6:55 AM, deadalnix wrote:
>>> As of for 2 I'd rather have a standard way to have attribute binding
>>> to the
>>> return type or the declaration. This is a recurring problem, and auto
>>> is simply
>>> one instance of it.
>>
>> I'm not understanding it being a recurring problem. There is a
>> recurring misunderstanding that attributes are applying to a type when
>> they are defined as applying to the declaration.
>>
>
> What is type of an impure function that return a pure, extern(C)
> function n D ?

Currently, it exists, yet cannot be named, and the formatted output of 
the compiler is wrong.

alias extern(C) int function()pure P;
P foo(){ return null; }

pragma(msg, typeof(&foo));

=> "extern (C) int function() pure function()"


More information about the Digitalmars-d mailing list