【发布时间】:2014-06-09 06:27:16
【问题描述】:
我的类型:
open System
type MyType (myFn : unit -> bool) =
member this.MyResult with get () = myFn ()
new (myFn : Func<bool>) = MyType (myFn.Invoke)
我得到的错误:
A unique overload for method 'MyType' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: new : myFn:(unit -> bool) -> MyType, new : myFn:Func<bool> -> MyType
既然我已经提供了类型注释,那么这不起作用的真正原因是什么?
【问题讨论】:
标签: c# constructor f# overloading