mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-16 02:58:38 +00:00
Merge commit '3bdfeaf8a1cb802ce4dce2cd12d6abd639edc75e' into generic-edge-cases
This commit is contained in:
@@ -19,6 +19,15 @@ type MethodImplParsed =
|
|||||||
| MethodImplementation of MethodImplementationHandle
|
| MethodImplementation of MethodImplementationHandle
|
||||||
| MethodDefinition of MethodDefinitionHandle
|
| MethodDefinition of MethodDefinitionHandle
|
||||||
|
|
||||||
|
type InterfaceImplementation =
|
||||||
|
{
|
||||||
|
/// TypeDefinition, TypeReference, or TypeSpecification
|
||||||
|
InterfaceHandle : MetadataToken
|
||||||
|
|
||||||
|
/// The assembly which InterfaceHandle is relative to
|
||||||
|
RelativeToAssembly : AssemblyName
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents detailed information about a type definition in a .NET assembly.
|
/// Represents detailed information about a type definition in a .NET assembly.
|
||||||
/// This is a strongly-typed representation of TypeDefinition from System.Reflection.Metadata.
|
/// This is a strongly-typed representation of TypeDefinition from System.Reflection.Metadata.
|
||||||
@@ -79,6 +88,8 @@ type TypeInfo<'generic, 'fieldGeneric> =
|
|||||||
Generics : 'generic ImmutableArray
|
Generics : 'generic ImmutableArray
|
||||||
|
|
||||||
Events : EventDefn ImmutableArray
|
Events : EventDefn ImmutableArray
|
||||||
|
|
||||||
|
ImplementedInterfaces : InterfaceImplementation ImmutableArray
|
||||||
}
|
}
|
||||||
|
|
||||||
override this.ToString () =
|
override this.ToString () =
|
||||||
@@ -175,6 +186,7 @@ module TypeInfo =
|
|||||||
Assembly = t.Assembly
|
Assembly = t.Assembly
|
||||||
Generics = gen
|
Generics = gen
|
||||||
Events = t.Events
|
Events = t.Events
|
||||||
|
ImplementedInterfaces = t.ImplementedInterfaces
|
||||||
}
|
}
|
||||||
|
|
||||||
let mapGeneric<'a, 'b, 'field> (f : int -> 'a -> 'b) (t : TypeInfo<'a, 'field>) : TypeInfo<'b, 'field> =
|
let mapGeneric<'a, 'b, 'field> (f : int -> 'a -> 'b) (t : TypeInfo<'a, 'field>) : TypeInfo<'b, 'field> =
|
||||||
@@ -255,6 +267,20 @@ module TypeInfo =
|
|||||||
|
|
||||||
result.ToImmutable ()
|
result.ToImmutable ()
|
||||||
|
|
||||||
|
let interfaces =
|
||||||
|
let result = ImmutableArray.CreateBuilder ()
|
||||||
|
|
||||||
|
for i in typeDef.GetInterfaceImplementations () do
|
||||||
|
let impl = metadataReader.GetInterfaceImplementation i
|
||||||
|
|
||||||
|
{
|
||||||
|
InterfaceHandle = MetadataToken.ofEntityHandle impl.Interface
|
||||||
|
RelativeToAssembly = thisAssembly
|
||||||
|
}
|
||||||
|
|> result.Add
|
||||||
|
|
||||||
|
result.ToImmutable ()
|
||||||
|
|
||||||
{
|
{
|
||||||
Namespace = ns
|
Namespace = ns
|
||||||
Name = name
|
Name = name
|
||||||
@@ -268,6 +294,7 @@ module TypeInfo =
|
|||||||
Assembly = thisAssembly
|
Assembly = thisAssembly
|
||||||
Generics = genericParams
|
Generics = genericParams
|
||||||
Events = events
|
Events = events
|
||||||
|
ImplementedInterfaces = interfaces
|
||||||
}
|
}
|
||||||
|
|
||||||
let isBaseType<'corelib>
|
let isBaseType<'corelib>
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
namespace WoofWare.PawPrint.Test
|
|
||||||
|
|
||||||
open Expecto
|
|
||||||
|
|
||||||
module Program =
|
|
||||||
[<EntryPoint>]
|
|
||||||
let main argv = runTestsInAssemblyWithCLIArgs [] argv
|
|
Reference in New Issue
Block a user