How to upcast `byref<'t>` to `byref<obj>` in F#?

68 views Asked by At

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

0

There are 0 answers

Related Questions in F#