jeudi 2 février 2023

How to upcast `byref<'t>` to `byref

I try to call JsonConverter<'t>.Read using reflection

static member ConvertRead (readInfo: MethodInfo, converter: JsonConverter, reader: byref<Utf8JsonReader>, typeToConvert: Type, options: JsonSerializerOptions) =
    readInfo.Invoke(converter, [| box reader; box typeToConvert; box options |])

and get FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL





Aucun commentaire:

Enregistrer un commentaire