jbevain / cecil

Cecil is a library to inspect, modify and create .NET programs and libraries.
MIT License
2.74k stars 624 forks source link

Make the Instruction constructor public #235

Open GregRos opened 9 years ago

GregRos commented 9 years ago

I find it rather annoying that the constructor Instruction (OpCode, object) isn't publicly visible. If you're not hand-coding additional instructions but getting them from another source (like another assembly), using the dedicated Instruction.Create methods that have strongly typed arguments and perform various checks just makes things needlessly difficult, forcing you to write complex switch statements to get around all the checks and signatures (in theory, of course; I just modified the source).

It's also kind of ill-fitting in a library that otherwise lets you do whatever you like.

SimonCropp commented 9 years ago

i have hit this one as well