← Back to index
|
Original Bugzilla link
Bug 8169 – Method loses its compile-time evaluability when used through alias this
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-30T10:17:00Z
Last change time
2012-05-30T22:37:12Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
tommitissari
Comments
Comment #0
by tommitissari — 2012-05-30T10:17:34Z
struct ValueImpl { static immutable(int) getValue() { return 42; } } struct ValueUser { ValueImpl m_valueImpl; alias m_valueImpl this; } void main(string[] args) { static assert(ValueUser.getValue() == 42); // #1 } Line #1 doesn't compile. Error: variable m_valueImpl cannot be read at compile time
Comment #1
by k.hara.pg — 2012-05-30T10:31:55Z
https://github.com/D-Programming-Language/dmd/pull/971