两个类,得到"类型未定义"错误

kit*_*une 5 f#

我有两个类,Foo和Bar,两个不同的文件,foo.fs和bar.fs

namespace Ganymede.Versioning

type foo = class 
    val Bar : bar
    new(input) = { Bar = input }    
    end


namespace Ganymede.Versioning

type bar = class
    val Test : string
    new (input) = { Test = input; }
    end
Run Code Online (Sandbox Code Playgroud)

我得到一个"类型'栏'没有定义." 类foo中的错误,forval Bar : bar

这是为什么?

GS *_*ica 11

项目中的文件必须按依赖顺序排序,因此您需要将bar.fs放在项目中的foo.fs之上,以便foo可以看到bar.