mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-11 00:38:40 +00:00
More corelib (#76)
This commit is contained in:
@@ -81,7 +81,9 @@ dotnet publish --self-contained --runtime-id osx-arm64 CSharpExample/ && dotnet
|
|||||||
|
|
||||||
* Functions should be fully type-annotated, to give the most helpful error messages on type mismatches.
|
* Functions should be fully type-annotated, to give the most helpful error messages on type mismatches.
|
||||||
* Generally, prefer to fully-qualify discriminated union cases in `match` statements.
|
* Generally, prefer to fully-qualify discriminated union cases in `match` statements.
|
||||||
|
* ALWAYS fully-qualify enum cases when constructing them and matching on them (e.g., `PrimitiveType.Int16` not `Int16`).
|
||||||
* When writing a "TODO" `failwith`, specify in the error message what the condition is that triggers the failure, so that a failing run can easily be traced back to its cause.
|
* When writing a "TODO" `failwith`, specify in the error message what the condition is that triggers the failure, so that a failing run can easily be traced back to its cause.
|
||||||
|
* If a field name begins with an underscore (like `_LoadedAssemblies`), do not mutate it directly. Only mutate it via whatever intermediate methods have been defined for that purpose (like `WithLoadedAssembly`).
|
||||||
|
|
||||||
### Development Workflow
|
### Development Workflow
|
||||||
|
|
||||||
|
@@ -141,6 +141,10 @@ type BaseClassTypes<'corelib> =
|
|||||||
RuntimeFieldHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
RuntimeFieldHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
RuntimeTypeHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
RuntimeTypeHandle : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
RuntimeType : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
RuntimeType : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
|
Void : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
|
TypedReference : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
|
IntPtr : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
|
UIntPtr : TypeInfo<WoofWare.PawPrint.GenericParameter>
|
||||||
}
|
}
|
||||||
|
|
||||||
[<RequireQualifiedAccess>]
|
[<RequireQualifiedAccess>]
|
||||||
|
@@ -114,6 +114,26 @@ module Corelib =
|
|||||||
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "RuntimeFieldHandle" then Some v else None)
|
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "RuntimeFieldHandle" then Some v else None)
|
||||||
|> Seq.exactlyOne
|
|> Seq.exactlyOne
|
||||||
|
|
||||||
|
let voidType =
|
||||||
|
corelib.TypeDefs
|
||||||
|
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "Void" then Some v else None)
|
||||||
|
|> Seq.exactlyOne
|
||||||
|
|
||||||
|
let typedReferenceType =
|
||||||
|
corelib.TypeDefs
|
||||||
|
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "TypedReference" then Some v else None)
|
||||||
|
|> Seq.exactlyOne
|
||||||
|
|
||||||
|
let intPtrType =
|
||||||
|
corelib.TypeDefs
|
||||||
|
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "IntPtr" then Some v else None)
|
||||||
|
|> Seq.exactlyOne
|
||||||
|
|
||||||
|
let uintPtrType =
|
||||||
|
corelib.TypeDefs
|
||||||
|
|> Seq.choose (fun (KeyValue (_, v)) -> if v.Name = "UIntPtr" then Some v else None)
|
||||||
|
|> Seq.exactlyOne
|
||||||
|
|
||||||
{
|
{
|
||||||
Corelib = corelib
|
Corelib = corelib
|
||||||
String = stringType
|
String = stringType
|
||||||
@@ -138,4 +158,8 @@ module Corelib =
|
|||||||
RuntimeMethodHandle = runtimeMethodHandleType
|
RuntimeMethodHandle = runtimeMethodHandleType
|
||||||
RuntimeFieldHandle = runtimeFieldHandleType
|
RuntimeFieldHandle = runtimeFieldHandleType
|
||||||
RuntimeType = runtimeTypeType
|
RuntimeType = runtimeTypeType
|
||||||
|
Void = voidType
|
||||||
|
TypedReference = typedReferenceType
|
||||||
|
IntPtr = intPtrType
|
||||||
|
UIntPtr = uintPtrType
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user