これは機能しません:
let increment(i: int byref) = i <- i + 1
let xxx = ref 0
increment(xxx) // this expression was expected to have type
// byref<int> but here has type int ref
しかし、これは機能します:
let incrementParam(a: int byref) = a <- a + 1
let mutable b = 30
incrementParam(&b)
これと同様に:
type Incrementor =
static member Increment(i : int byref) =
i <- i + 1
let fff = ref 10
Incrementor.Increment(fff)