-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
As requirement, I need to replace newobj instruction with static method call. But, it may be helpful in future to have replacer for all instructions.
TryReplaceInstruction( OpCodes.Newobj, OnNewobjectCall );
var strange = new Object();
// ...
var TType OnNewobjectCall(TypeHandler type)
{
if(type == typeof(object).TypeHandler)
{
Console.WriteLine(Type.FromTypeHandler(type).Name);
}
return new object();
}