mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-05 14:18:40 +00:00
Tidy up a bit (#108)
This commit is contained in:
@@ -463,8 +463,7 @@ module Assembly =
|
||||
match targetType with
|
||||
| [ t ] ->
|
||||
let t =
|
||||
t
|
||||
|> TypeInfo.mapGeneric (fun _ (param, md) -> genericArgs.[param.SequenceNumber])
|
||||
t |> TypeInfo.mapGeneric (fun (param, md) -> genericArgs.[param.SequenceNumber])
|
||||
|
||||
TypeResolutionResult.Resolved (assy, t)
|
||||
| _ :: _ :: _ -> failwith $"Multiple matching type definitions! {nsPath} {target.Name}"
|
||||
@@ -490,7 +489,7 @@ module Assembly =
|
||||
| Some typeDef ->
|
||||
let typeDef =
|
||||
typeDef
|
||||
|> TypeInfo.mapGeneric (fun _ (param, md) -> genericArgs.[param.SequenceNumber])
|
||||
|> TypeInfo.mapGeneric (fun (param, md) -> genericArgs.[param.SequenceNumber])
|
||||
|
||||
TypeResolutionResult.Resolved (assy, typeDef)
|
||||
| None ->
|
||||
|
@@ -50,7 +50,6 @@ type ConcreteType<'typeGeneric> =
|
||||
override this.GetHashCode () : int =
|
||||
hash (this._AssemblyName.FullName, this._Definition, this._Generics)
|
||||
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module ConcreteType =
|
||||
let make
|
||||
|
@@ -189,8 +189,8 @@ module TypeInfo =
|
||||
ImplementedInterfaces = t.ImplementedInterfaces
|
||||
}
|
||||
|
||||
let mapGeneric<'a, 'b, 'field> (f : int -> 'a -> 'b) (t : TypeInfo<'a, 'field>) : TypeInfo<'b, 'field> =
|
||||
withGenerics (t.Generics |> Seq.mapi f |> ImmutableArray.CreateRange) t
|
||||
let mapGeneric<'a, 'b, 'field> (f : 'a -> 'b) (t : TypeInfo<'a, 'field>) : TypeInfo<'b, 'field> =
|
||||
withGenerics (t.Generics |> ImmutableArray.map f) t
|
||||
|
||||
let internal read
|
||||
(loggerFactory : ILoggerFactory)
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="StringToken.fs" />
|
||||
<Compile Include="ImmutableArray.fs" />
|
||||
<Compile Include="Tokens.fs" />
|
||||
<Compile Include="TypeRef.fs" />
|
||||
<Compile Include="IlOp.fs" />
|
||||
|
@@ -378,7 +378,7 @@ module IlMachineState =
|
||||
|
||||
let defn =
|
||||
assy.TypeDefs.[defn.Get]
|
||||
|> TypeInfo.mapGeneric (fun _ (param, _) -> typeGenericArgs.[param.SequenceNumber])
|
||||
|> TypeInfo.mapGeneric (fun (param, _) -> typeGenericArgs.[param.SequenceNumber])
|
||||
|
||||
state, assy, defn
|
||||
| TypeDefn.FromReference (ref, _typeKind) ->
|
||||
|
@@ -874,7 +874,7 @@ module internal UnaryMetadataIlOp =
|
||||
state,
|
||||
activeAssy,
|
||||
activeAssy.TypeDefs.[defn]
|
||||
|> TypeInfo.mapGeneric (fun _ (p, _) -> TypeDefn.GenericTypeParameter p.SequenceNumber)
|
||||
|> TypeInfo.mapGeneric (fun (p, _) -> TypeDefn.GenericTypeParameter p.SequenceNumber)
|
||||
| MetadataToken.TypeSpecification spec ->
|
||||
let state, assy, ty =
|
||||
IlMachineState.resolveTypeFromSpecConcrete
|
||||
@@ -938,7 +938,7 @@ module internal UnaryMetadataIlOp =
|
||||
state,
|
||||
activeAssy,
|
||||
activeAssy.TypeDefs.[defn]
|
||||
|> TypeInfo.mapGeneric (fun _ (p, _) -> TypeDefn.GenericTypeParameter p.SequenceNumber)
|
||||
|> TypeInfo.mapGeneric (fun (p, _) -> TypeDefn.GenericTypeParameter p.SequenceNumber)
|
||||
| MetadataToken.TypeSpecification spec ->
|
||||
let state, assy, ty =
|
||||
IlMachineState.resolveTypeFromSpecConcrete
|
||||
|
@@ -6,7 +6,7 @@ open System.Reflection
|
||||
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
|
||||
module internal UnaryStringTokenIlOp =
|
||||
let execute
|
||||
(baseClassTypes : BaseClassTypes<'a>)
|
||||
(baseClassTypes : BaseClassTypes<DumpedAssembly>)
|
||||
(op : UnaryStringTokenIlOp)
|
||||
(sh : StringToken)
|
||||
(state : IlMachineState)
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Tuple.fs" />
|
||||
<Compile Include="ImmutableArray.fs" />
|
||||
<Compile Include="Result.fs" />
|
||||
<Compile Include="Corelib.fs" />
|
||||
<Compile Include="AbstractMachineDomain.fs" />
|
||||
|
Reference in New Issue
Block a user