Files
2025-06-04 19:13:16 +00:00

34 lines
1.0 KiB
Forth

namespace WoofWare.PawPrint
open System.Reflection
open System.Reflection.Metadata
/// <summary>
/// Represents a type specification in assembly metadata.
/// Type specifications describe complex types like generic instantiations,
/// arrays, pointers, and other composite types.
/// </summary>
type TypeSpec =
{
/// <summary>
/// The metadata token handle that uniquely identifies this type specification.
/// </summary>
Handle : TypeSpecificationHandle
/// <summary>
/// The full type definition/signature of this type specification.
/// This contains all the details about the composite type structure.
/// </summary>
Signature : TypeDefn
}
[<RequireQualifiedAccess>]
module TypeSpec =
let make (assembly : AssemblyName) (handle : TypeSpecificationHandle) (r : TypeSpecification) : TypeSpec =
let spec = r.DecodeSignature (TypeDefn.typeProvider assembly, ())
{
Handle = handle
Signature = spec
}