Restrições de membro F # + ^ a parâmetros byref

Após algumas brincadeiras, as restrições de membro do F # apresentam e funcionam como esta:

let inline parse< ^a when ^a : (static member Parse: string -> ^a) > s =
    (^a: (static member Parse: string -> ^a) s)

Isso funciona perfeitamente bem:

let xs = [ "123"; "456"; "999" ] |> List.map parse<int>

Estou tentando escrever outra funçãotryParse, que usa o método estáticoTryParse e envolve o resultado da análise em'a option digite para melhor suporte em F #. Algo assim não compila:

let inline tryParse s =
    let mutable x = Unchecked.defaultof< ^a>
    if (^a: (static member TryParse: string * ^a byref -> bool) (s, &x))
        then Some x else None

O erro é:

erro FS0001: Esperava-se que essa expressão tivesse tipobyref <'a> mas aqui tem tipo'a ref

F #ref-cells também não funciona:

let inline tryParse s =
    let x = ref Unchecked.defaultof< ^a>
    if (^a: (static member TryParse: string * ^a byref -> bool) (s, x))
        then Some x else None

O que estou fazendo errado?

questionAnswers(3)

yourAnswerToTheQuestion