我在 C# 中有一个带有此返回类型的方法的接口:
Task<(Guid, int)?>
我需要在 F# 中实现这个接口,如果我没记错的话,这在 F# 中应该是等价的:
Task<Nullable<ValueTuple<Guid, int>>>
不幸的是,当我编译时,我收到了这条消息:
generic construct requires that the type 'struct (Guid * int)' have a public default constructor
我发现了一些类似的问题,看起来解决方案是使用[<CLIMutable>]
属性。但这不是我可以用 System.ValueTuple 做的事情。有没有办法在 F# 中使用 Nullable ValueTuple?