我有以下代码
module File1
let convert<'T> x = x
type myType () =
member this.first<'T> y =
convert<'T> y
member this.second<'T> ys =
ys
|> Seq.map this.first<'T>
最后'T
我得到了错误Unexpected type arguments
。例如,当我打电话let x = myType.first<int> "34"
时,没有警告,一切都按预期工作。保留类型参数可以消除警告,并且程序有时会按预期运行。
谁能解释这里发生了什么?
谢谢