[Issue 3156] auto works like scope instead of type inference, which leads to silent breakage

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 8 17:59:31 PDT 2009


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


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com




--- Comment #5 from Stewart Gordon <smjg at iname.com>  2009-07-08 17:59:30 PDT ---
> The specification 
> (http://www.digitalmars.com/d/1.0/declaration.html#AutoDeclaration) 
> says auto does type inference.  There's no word about memory 
> allocation.  I think the above behavior is left over from the past, 
> when auto used to do the same as scope.

Unless I'm mistaken, this hasn't changed.  That meaning is just invoked using a
different syntax, with a type between 'auto' and the variable's name.

> I suggest to fix this and make auto to do type inference only, just 
> like the specification describes the auto keyword.

Indeed, I don't know whether Walter just forgot to remove it from the compiler,
planned to do it later or what.  But it ought to be at least deprecated now. 
This meaning of 'scope' was introduced in 0.174 back in 2006.

See also bug 2716.

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