The Type.MakeByRefType
method in .NET returns a by-ref version of a type, e.g. passing the type of System.Int32
returns a type representing System.Int32&
.
However, if you already have a System.Int32&
, what is the mechanism for obtaining a plain old System.Int32
? There doesn't seem to be an opposite method to remove the by-ref modifier.
At the moment I've put a hack in place which re-builds the assembly-qualified name without an &
at the end of the type name and then loads that type, but this is horribly dirty...