我在 F# 中有以下声明:
type ConstArg =
| Bool of bool
| CharArray of char[]
member Lambda (ConstArg : ConstArg[]) = ...
在 C# 中,我构建了一个包含两个值的 char[] 数组:
char[][] list = new char[][] {firstArray, secondArray};
我想要调用.Lambda(list)
,但我无法将list转换为ConstArg[]
ConstArg
对象,因为CharArray
和Bool
都是ConstArg
类型的实例。因此,将其传递给lambda不会有任何问题。 - Sergey Berezovskiy