2010-05-13 99 views
4
type A() = 
    static member B() =() 
    static member B(x) = B() //ERROR: The value or constructor 'B' is not defined 

回答

5

當引用F#中的靜態成員時,需要使用全名(包括類型的名稱)。 F#編譯器不會自動查找當前類的靜態成員。

下面應該工作:

type A() = 
    static member B() =() 
    static member B(x) = A.B() 
相關問題