Bug 10840 – [CTFE] *this._data.arr is not yet implemented at compile time
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-17T14:54:00Z
Last change time
2013-08-29T06:14:19Z
Keywords
CTFE
Assigned to
nobody
Creator
dmitry.olsh
Comments
Comment #0 by dmitry.olsh — 2013-08-17T14:54:39Z
Found while working on std.regex. std.array.Append will sometimes fail with that message.
Simpified test case:
bool empty(int[] arr)
{
return arr.length == 0;
}
struct Appender
{
private struct Data
{
size_t capacity;
int[] arr;
}
private Data* _data;
@property int[] data() @trusted pure nothrow
{
return (_data ? _data.arr : null);
}
}
struct Stack
{
Appender stack;
@property bool empty(){ return stack.data.empty; }
}
bool foo()
{
Stack app;
return app.empty;
}
pragma(msg, foo());
Outputs (tested with git HEAD 2.064):
ctfe_fail.d(18): Error: *this._data.arr is not yet implemented at compile time
ctfe_fail.d(25): called from here: this.stack.data()
ctfe_fail.d(25): called from here: empty(this.stack.data())
ctfe_fail.d(32): called from here: app.empty()
ctfe_fail.d(36): called from here: foo()
ctfe_fail.d(36): while evaluating pragma(msg, foo())
Comment #1 by github-bugzilla — 2013-08-21T04:38:39Z