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

@@ -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> =