Bug 12288 – delegate literals should be allowed as class members

Status
REOPENED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-02T13:15:22Z
Last change time
2024-12-13T18:17:43Z
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#17643 →

Comments

Comment #0 by timon.gehr — 2014-03-02T13:15:22Z
Eg, the following code should compile: template ID(alias a){ alias ID=a; } class C{ int x=3; alias a = ID!(()=>x); } static assert(new C().a()==3);
Comment #1 by timon.gehr — 2014-03-02T13:16:43Z
*** Issue 7653 has been marked as a duplicate of this issue. ***
Comment #2 by pro.mathias.lang — 2020-12-31T04:58:20Z
``` class C{ int x=3; auto a() => x; } static assert(new C().a()==3); ``` This now compiles with `-preview=shortenedMethod`. Marking as a duplicate of 7176 as a consequence. *** This issue has been marked as a duplicate of issue 7176 ***
Comment #3 by timon.gehr — 2020-12-31T12:11:52Z
This is not a duplicate, this issue is not about syntax at all!
Comment #4 by robert.schadek — 2024-12-13T18:17:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17643 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB