Conditions: Use aggregate initialization on a structure that has a static array, while making the argument an element type of the array. EG:
//----
import std.conv;
struct S
{
int i;
int[2] ii;
}
void main()
{
S s = S(1, 2); //OK
emplace(&s, 1, 2); //Chokes
}
//----
The issue is in "emplacePostblitter", which is confused when it is asked to postblit a type over something that isn't the same type.
"Luckilly", compilation stops, instead of potentially doing wrong code.
On topic, I'm really not a huge fan of "S s = S(1, 2); //OK": This is basically implicit promotion from "int" to "int[2]". D usually bans implicit pormotion, and *every time* I have seen this "aggregate initialization with static array promotion" "feature" I (and others on the boards) have been surprised by it.
Introduced by pull:
https://github.com/D-Programming-Language/phobos/pull/1082
Comment #1 by monarchdodra — 2013-09-06T08:09:50Z
While I am at it: emplacePostblitter does not correctly handle class types either, if one of the nested members is a class.