我想知道为什么第二行报告编译器错误
类型关系与 seq<'a> 不兼容
而第一个推断 r 的类型关系。
type Microsoft.Office.Interop.Access.Dao.Database with
member x.f() =
let relations = [for r in x.Relations -> r]
let relations2 = x.Relations |> Seq.map id
()
什么精确的属性使得使用 for 循环关系成为可能?
//编辑复制步骤:
我在VS2012中创建一个空白解决方案,添加对Microsoft.Office.Interop.Access.Dao的引用,并粘贴下面的代码。
module toto =
type Class1() =
member this.X = "F#"
type Microsoft.Office.Interop.Access.Dao.Database with
member x.f() =
let relations = [for r in x.Relations -> r]
let relations2 = x.Relations |> Seq.map id
()
r 类型为 Relation,而不是 obj