fixed!
now there's another one: can't create a new object from the type:

[Fact]
public void CecilRepro()
{
var asm = AssemblyFactory.GetAssembly(this.GetType().Assembly.Location);
var listOfObject = asm.MainModule.Import(typeof(List<object>));
var method = asm.MainModule.Types.Cast<TypeDefinition>()
.Where(t => t.FullName == this.GetType().FullName)
.Single()
.Methods.Cast<MethodDefinition>()
.Where(m => m.Name == "CecilRepro")
.Single();

var il = method.Body.CilWorker;
var argsVar = new VariableDefinition(listOfObject);
method.Body.Variables.Add(argsVar);
il.InsertBefore(method.Body.Instructions[0],
il.Create(OpCodes.Newobj, listOfObject));
}

fails with:


TestCase 'Moq.Tests.Instrumentation.InstrumentationFixture.FailsToImport'
failed: System.ArgumentException : opcode
at Mono.Cecil.Cil.CilWorker.Create(OpCode opcode, TypeReference type)
D:\Code\moq\UnitTests\Instrumentation\InstrumentationFixture.cs(49,0): at
Moq.Tests.Instrumentation.InstrumentationFixture.FailsToImport()




On Mon, Jan 5, 2009 at 5:10 PM, Jb Evain <[email protected]> wrote:

>
> On 1/5/09, Jb Evain <[email protected]> wrote:
> > I can repro it now. Let me see if I can fixicate it quickly.
>
> That should be fixed in svn (the anonsvn will be updated in less than
> 30min from now).
>
> --
> Jb Evain  <[email protected]>
>
> >
>


-- 
Daniel Cazzulino | Developer Lead | XML MVP | Clarius Consulting | +1
425.329.3471

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to