[Issue 5436] New: tightening auto decl spec
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 8 19:33:41 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5436
Summary: tightening auto decl spec
Product: D
Version: unspecified
Platform: Other
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: ellery-newcomer at utulsa.edu
--- Comment #0 from Ellery Newcomer <ellery-newcomer at utulsa.edu> 2011-01-08 19:31:58 PST ---
In spec and implementation, auto decls are defined as
StorageClasses Identifier = Initializer, etc ;
However, as near as I can tell, Initializer could be replaced with Expression
with no loss, as none of the initializer forms disjoint from Expression allow
type deduction.
You could argue that something like this could work:
auto x = [s, {a:1,b:2,c:3}];
but it doesn't. Maybe you could argue for the indexed initializers like:
int[] x = [4,1:2];
but thankfully, that isn't implemented for auto decls either.
It really doesn't make sense to have the compiler parse things which will never
pass semantic analysis, so I propose that both spec and implementation be
changed to
StorageClasses Identifier = Expression, etc ;
--
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