Mitigating the attribute proliferation - attribute inference for functions

w0rp via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 13 06:45:18 PDT 2015


On Monday, 13 April 2015 at 12:13:26 UTC, Kagamin wrote:
> On Saturday, 11 April 2015 at 21:47:20 UTC, Martin Nowak wrote:
>> 1) If that function has source code available, it gets 
>> semantically
>> analyzed and additional attributes are inferred.
>>
>> 2) The compiler errors because of missing attributes.
>
> I'd say, if you have the function body, you can infer its 
> attributes, else you have its signature annotated with 
> attributes, then they are honored normally.

I was saying the same before. If you have the source, do 
inference. If you don't, no inference will be done. I think that 
will remove a lot of typing already. There are many cases where 
it won't be able to infer the attributes, but it's still better 
than nothing.


More information about the Digitalmars-d mailing list