More ToString (#46)

This commit is contained in:
Patrick Stevens
2025-06-15 16:54:57 +01:00
committed by GitHub
parent f3565fe8b5
commit edbf3b71e5
2 changed files with 16 additions and 0 deletions

View File

@@ -244,6 +244,12 @@ type TypeResolutionResult =
| FirstLoadAssy of WoofWare.PawPrint.AssemblyReference
| Resolved of DumpedAssembly * TypeInfo<TypeDefn>
override this.ToString () : string =
match this with
| TypeResolutionResult.FirstLoadAssy a -> $"FirstLoadAssy(%s{a.Name.FullName})"
| TypeResolutionResult.Resolved (assy, ty) ->
$"Resolved(%s{assy.Name.FullName}: {string<TypeInfo<TypeDefn>> ty})"
[<RequireQualifiedAccess>]
module Assembly =
let read (loggerFactory : ILoggerFactory) (originalPath : string option) (dllBytes : Stream) : DumpedAssembly =

View File

@@ -81,17 +81,27 @@ type TypeInfo<'generic> =
Events : EventDefn ImmutableArray
}
override this.ToString () =
$"%s{this.Assembly.Name}.%s{this.Namespace}.%s{this.Name}"
type TypeInfoEval<'ret> =
abstract Eval<'a> : TypeInfo<'a> -> 'ret
type TypeInfoCrate =
abstract Apply<'ret> : TypeInfoEval<'ret> -> 'ret
abstract ToString : unit -> string
[<RequireQualifiedAccess>]
module TypeInfoCrate =
let make<'a> (t : TypeInfo<'a>) =
{ new TypeInfoCrate with
member _.Apply e = e.Eval t
member this.ToString () =
{ new TypeInfoEval<_> with
member _.Eval this = string<TypeInfo<_>> this
}
|> this.Apply
}
type BaseClassTypes<'corelib> =