In the Core runtime, a FieldAccessException is thrown.
Found by newly added tests in #97784
Repro
FieldInfofieldInfo=typeof(MyStruct).GetField(nameof(MyStruct.fcnPtr));fieldInfo.SetValue(newMyStruct(),(IntPtr)200);// Result: assert or does nothingpublicstructMyStruct{publicunsafedelegate*<void>fcnPtr=(delegate*<void>)44;publicMyStruct(){}}Asserts include
type 0x1b not handled in ves_icall_FieldInfo_SetValueInternal
type 0x1b not handled in mono_field_get_value_object
In the Core runtime, a
FieldAccessExceptionis thrown.Found by newly added tests in #97784
Repro
Asserts include