On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't make sense
to me. Might be a bug in the compiler.
This one works:
----
struct Stack(T) {
T[] stack;
alias stack this;
bool empty() {return empty(stack);} /* not using UFCS */
import std.array: empty; /* has to come after the method */
}
----
Looks very much like a compiler bug now. As far as I know, the order of
declarations shouldn't have an effect like that in structs. And UFCS
should also be ok there, as far as I can tell.