Attribute inference for auto functions?

Jesse Phillips Jessekphillips+D at gmail.com
Wed Apr 17 10:35:52 PDT 2013


On Wednesday, 17 April 2013 at 16:26:30 UTC, Rob T wrote:
> The proposal therefore seems to be about extending D to always 
> perform attribute inference along with type inference unless 
> the attributes are explicitly specified.
>
> The question I have is if the proposal wants to extend the 
> meaning of the "auto' keyword so that it will be required in 
> order for attribute inference to take place, but that indeed 
> does confuse things because we're using the same keyword for 
> two completely two different purposes, and it clashes with the 
> use of auto in some cases.
>
> -rt

This is a very good description of the change.

I don't think auto should be made specific to attribute 
inference. So I think the discussion should consider:

const foo()//...

would that be something that should also be a attribute 
inference. I think I'm still ok with that as it is still 
requesting inference. Note that you can not specify an inferred 
const return type. That is this makes a the function const (not 
valid as a free form function), and not the return type.


More information about the Digitalmars-d mailing list