F# forward type declarations

前端 未结 3 1277
终归单人心
终归单人心 2020-11-28 13:04

I stumbled across this problem in F#. Suppose, I want to declare two types that reference each other:


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


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 14:04

    The limitation is that the types have to be declared in the same file.

提交回复
热议问题