This c# will crash AlterNative: class foo { float[] bar = { 1,2,3 }; };
It's easier to see why that might be when you try this:
class foo {
void baz() {
float[] bar = { 1, 2, 3 };
}
};
which results in
void foo::baz(){
RuntimeHelpers::InitializeArray(new Array<float>(3), fieldof(<PrivateImplementationDetails>{169D9E6B-C4D0-4476-851A-DD23AA0A2F9B}::$$method0x6000001-1)->FieldHandle);
}
For 1 or 2 elements, the c# compiler will emit array stores. For the 3rd element it begins emitting that ugly hacky approach.