> Since I can't see a reply, I guess my email trying to clear this up has
> still left you confused :-). Can you maybe be a little more specific
> about what I need to explain better? I gave some C# code to try and
> illustrate it already..

You say you want to emit code like this:
> ldarga bar
> call [mscorlib]System.Nullable`1<int>.get_HasValue
> brtrue LABEL
> ldstr "bar"
> ldstr "Yes this is a stupid example"
> newobj [mscorlib]System.ArgumentNullException
> throw
> LABEL: nop
> // Some stuff goes here

But you need to substitute Nullable`1<int> with other nullable types, right?

So you can't use this code:
> this.module.Import(typeof(Nullable<int>).GetProperty("HasValue").GetGetMethod())

But when emitting the code, you probably know the concrete nullable
types you want to work with, right? So, if you have nullable type NT
at the time of emitting code, why not just do this:

> this.module.Import(typeof(NT).GetProperty("HasValue").GetGetMethod())

?

I'm probably missing something, but maybe you could elaborate on what it is.

Fabian

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

Reply via email to