The following worked on an earlier head of 2.059, but as of yesterday, it fails: import std.algorithm, std.array, std.utf, std.conv; void main() { auto ok = [1].map!("a*1")().array(); __gshared auto ok2 = [1].map!("a*1")(); __gshared auto bug = [1].map!("a*1")().array(); } Only tested on linux with and without -m32
Oh, and the following works too: __gshared int[] ok3; ok3 = [1].map!("a*1")().array();
This program: import std.algorithm, std.array; void main() { __gshared r = [1].map!q{a * 1}(); } gives to me (2.059head, 32 bit Windows): ...\dmd2\src\phobos\std\algorithm.d(461): Error: nested structs with constructors are not yet supported in CTFE (Bug 6419) test.d(3): called from here: map([1])
Not a regression - didn't work on any prior release.
Pretty sure it worked at the start of this week.
I'm not sure what is wrong. __gshared variable declaration is treated like static variable one (even if it is in local), and its initializer is *always* const-folded by interpretation(== CTFE). And the behavior is in there from earlier than 2.058. So I'm sure that the expressions have been failed to compile with bug 6419 and this issue never relates to UFCS. To simendsjo: Please tell us the exact commit hash of dmd repository that succeeds to compile the code. If you cannot do it, I'll close this bug as "resolved invalid" bug.
(In reply to comment #4) > Pretty sure it worked at the start of this week. It only gets a 'regression' tag if it worked as part of a release.