生成类型提供程序似乎在具有多个根类型方面存在问题。
完整的复现代码可以在此处找到:https://gist.github.com/dsevastianov/46d1a8495c4af46a9875。以下是一个示例:
#r @"SampleProvider.dll"
type Birch = Sample.Sample<"birch">
type Elm = Sample.Sample<"elm">
let birch = Birch.birch()
let elm = Elm.elm()
elm.Branches <- ([|Elm.elm()|])
在编译时失败(而不是设计时):
FSC: error FS2014: A problem occurred writing the binary 'obj\Debug\Tests.dll':
Error in pass3 for type Schema, error: Error in GetMethodRefAsMethodDefIdx for
mref = (".ctor", "ZipLookup"), error: Exception of type Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter+MethodDefNotFound' was thrown.