假设我有一组向量类型(la-xna),其中一些类型有静态成员 Cross :
Cross
type Vector3 = ... static member Cross (a : Vector3, b : Vector3) = new Vector3(...)
我可以定义 cross 函数及其编译:
cross
let inline cross (x : ^T) (y : ^T) = (^T : (static member Cross : (^T * ^T) -> ^T) ((x,y)))
很遗憾,我无法使用它,并出现以下错误:
let res = cross a b ^
成员或对象构造函数交叉 接受2个参数,但此处给出 1。所需签名是静态成员vector3。交叉: A:矢量3*B:矢量3-> 矢量3
有可能吗?谢谢你的帮助!
let inline cross (x : ^T) (y : ^T) = (^T : (static member Cross : ^T * ^T -> ^T) (x,y))