On Saturday, 11 January 2014 at 18:48:15 UTC, Maxim Fomin wrote:
It is legal exactly because function is marked as pure. Result of pure function is implicitly convertible to immutable.
It shouldn't be here though... the reason it is implicitly convertable is that pure means the result is unique. But, with the hidden this pointer having a reference to the data as well, it obviously is not unique. I think the compiler should catch this; i'd call it a bug.