[Issue 10840] New: [CTFE] *this._data.arr is not yet implemented at compile time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Aug 17 14:54:40 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10840
Summary: [CTFE] *this._data.arr is not yet implemented at
compile time
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: dmitry.olsh at gmail.com
--- Comment #0 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-08-17 14:54:39 PDT ---
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())
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list