0
當使用任何類型的可調整數組時,我無法循環該數組,f#似乎不理解我的預定義類型。 這裏是一個示例代碼:錯誤FS0193:內部錯誤:無法從程序集'FSI-ASSEMBLY,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null'加載'anyType'類型
type someData = {
Entry:string ; id:int }
let datas = new ResizeArray<someData>()
let record1 = {someData.Entry = "hiLo" ;someData.id =1234 }
datas.Add(record1)
let record2 = {someData.Entry = "Lolo" ;someData.id =1224 }
datas.Add(record2)
let record3 = {someData.Entry = "Hihi" ;someData.id =1231 }
datas.Add(record3)
let nameOnly = new ResizeArray<string>()
for entries in datas do
nameOnly.Add(entries.Entry)
Thx,你的代碼似乎解決了這個問題,雖然我老實說不明白:) **我認爲它與被放入交互式**模塊的類型有關 – Decembermoon