Hello,
I am currently overriding the setter of a given class with Reflection.Emit. Everything works fine except when I use it with a nullable property....
Here is the code I use :
ilSetterGen.Emit(OpCodes.Ldarg_0);
ilSetterGen.Emit(OpCodes.Call, baseGetter);
ilSetterGen.Emit(OpCodes.Ldarg_1);
ilSetterGen.Emit(OpCodes.Ceq);
Label retLabel = ilSetterGen.DefineLabel();
ilSetterGen.Emit(OpCodes.Brtrue_S, retLabel);
ilSetterGen.MarkLabel(retLabel);
ilSetterGen.Emit(OpCodes.Ret);
Do you have any clue ?
EDIT : as pointed out in the answer the problem is in the equality test... I so removed the irrelevants part...