質問

私はF#で、この問題に出くわし。私はお互いを参照する2つのタイプを宣言したい、とします:


type firstType = 
     | T1 of secondType
     //................

type secondType =
     | T1 of firstType  
     //................    

私はそれを行うにはどうすればよい、コンパイラはエラーを生成しませんので、?

役に立ちましたか?

解決

あなたが使用して 'と'

type firstType = 
     | T1 of secondType

and secondType =
     | T1 of firstType

他のヒント

私はそれを考え出しました。イッツます:


type firstType = 
     | T1 of secondType
     //................

and secondType =
     | T1 of firstType  
     //................   

制限はタイプが同じファイルで宣言されなければならないことである。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top