Recognise runtime types (#45)

This commit is contained in:
Patrick Stevens
2025-06-15 15:54:21 +01:00
committed by GitHub
parent 89e6e1b4e8
commit 30925a2bc6
2 changed files with 21 additions and 0 deletions

View File

@@ -115,6 +115,9 @@ type BaseClassTypes<'corelib> =
ValueType : TypeInfo<WoofWare.PawPrint.GenericParameter>
DelegateType : TypeInfo<WoofWare.PawPrint.GenericParameter>
Object : TypeInfo<WoofWare.PawPrint.GenericParameter>
RuntimeMethodHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
RuntimeFieldHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
RuntimeTypeHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
}
[<RequireQualifiedAccess>]

View File

@@ -94,6 +94,21 @@ module Corelib =
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "Delegate" then Some v else None)
|> Seq.exactlyOne
let runtimeMethodHandleType =
corelib.TypeDefs
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "RuntimeMethodHandle" then Some v else None)
|> Seq.exactlyOne
let runtimeTypeHandleType =
corelib.TypeDefs
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "RuntimeTypeHandle" then Some v else None)
|> Seq.exactlyOne
let runtimeFieldHandleType =
corelib.TypeDefs
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "RuntimeFieldHandle" then Some v else None)
|> Seq.exactlyOne
{
Corelib = corelib
String = stringType
@@ -114,4 +129,7 @@ module Corelib =
ValueType = valueType
DelegateType = delegateType
Object = objType
RuntimeTypeHandle = runtimeTypeHandleType
RuntimeMethodHandle = runtimeMethodHandleType
RuntimeFieldHandle = runtimeFieldHandleType
}