Type inference in sequence expressions in F#
问题 I think I do not quite understand how F# infers types in sequence expressions and why types are not correctly recognized even if I specify the type of the elements directly from "seq". In the following F# code we have a base class A and two derived classes, B and C: type A(x) = member a.X = x type B(x) = inherit A(x) type C(x) = inherit A(x) If I try to "yield" their instances in a simple sequence expressions, I get two errors: // Doesn't work, but it makes sense. let testSeq = seq { yield A