我正在尝试重写一个带有byref参数的方法,以下代码是一个例子:
type Incrementor(z) =
abstract member Increment : int byref * int byref -> unit
default this.Increment(i : int byref,j : int byref) =
i <- i + z
type Decrementor(z) =
inherit Incrementor(z)
override this.Increment(i : int byref,j : int byref) =
base.Increment(ref i,ref j)
i <- i - z
但是编译器给我返回了以下错误:
A type instantiation involves a byref type. This is not permitted by the rules of Common IL.
我不明白问题出在哪里。