Bug 5436 – tightening auto decl spec

Status
NEW
Severity
enhancement
Priority
P4
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-01-08T19:31:58Z
Last change time
2024-12-15T15:21:41Z
Keywords
spec
Assigned to
No Owner
Creator
Ellery Newcomer
Moved to GitHub: dlang.org#3933 →

Comments

Comment #0 by ellery-newcomer — 2011-01-08T19:31:58Z
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 ;
Comment #1 by robert.schadek — 2024-12-15T15:21:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/3933 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB