namespace WoofWare.PawPrint
open System.Collections.Immutable
open System.Reflection
open System.Reflection.Metadata
///
/// Represents a method specification, which provides information about a method,
/// particularly for generic method instantiations.
///
type MethodSpec =
{
///
/// The token that identifies the method being specialized.
///
Method : MetadataToken
Signature : TypeDefn ImmutableArray
}
[]
module MethodSpec =
let make (assemblyName : AssemblyName) (p : MethodSpecification) : MethodSpec =
let signature = p.DecodeSignature (TypeDefn.typeProvider assemblyName, ())
{
// Horrible abuse to get this as an int
Method = MetadataToken.ofInt (p.Method.GetHashCode ())
Signature = signature
}