Bug 3011 – alias should have assignment syntax

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-05-20T04:19:00Z
Last change time
2017-07-03T18:16:06Z
Keywords
pull
Assigned to
nobody
Creator
dhasenan
See also
https://issues.dlang.org/show_bug.cgi?id=12204

Comments

Comment #0 by dhasenan — 2009-05-20T04:19:05Z
alias and typedef should have assignment syntax to correspond with assignments and renamed imports. Whenever I see or want to write "alias a b", it takes some thinking to remember what order the arguments should be in. If aliases worked as "alias newsymbol = existingsymbol", it would be trivial to determine which symbol is new and which it refers to. Typedef has the same ugly syntax, so the same change should apply to it.
Comment #1 by nick — 2012-08-25T08:50:26Z
I removed typedef from the title as it is now deprecated in D2. Besides assignment syntax having consistency with renamed imports and variable declarations, the current alias syntax is awkward to read and confusing for newcomers. Alias assignment syntax should also be used for alias this: struct Foo { alias this = foo; ... }
Comment #2 by nick — 2012-08-25T09:02:28Z
Also alias is often used to alias symbols, not just types. So using C typedef syntax is weird, especially now typedef is deprecated in D.
Comment #3 by k.hara.pg — 2012-10-16T10:01:19Z
Comment #4 by github-bugzilla — 2012-10-22T09:50:26Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/796aba2877e2db672806c2f2562e0c5a2f30ab17 fix Issue 3011 - alias should have assignment syntax https://github.com/D-Programming-Language/dmd/commit/6c01188d71433508bc4c0af6b821a97e8df2e986 Merge pull request #1187 from 9rnsr/fix3011 [enh] Issue 3011 - alias should have assignment syntax
Comment #5 by github-bugzilla — 2012-10-22T09:50:55Z
Comment #6 by yebblies — 2012-11-15T03:21:16Z
Is this finished now?
Comment #7 by k.hara.pg — 2012-11-15T05:41:48Z
(In reply to comment #6) > Is this finished now? Yes. I close this now.