Dictionary 为什么这段代码在第二次在FSI中执行时会崩溃?

Dictionary 为什么这段代码在第二次在FSI中执行时会崩溃?,dictionary,f#,fsi,Dictionary,F#,Fsi,我有一些代码在第二次执行时生成异常,它是在FSI中执行的。顺序如下: 1) 选择它上面的所有行,使用Alt+Enter在FSI上运行 2) 选择代码,使用Alt+Enter在FSI上运行。到目前为止没有错误 3) 点击Alt+Enter,再次运行所选代码。错误(见下文) 以下是生成此行为的代码行: let assetsMap = assetInfo.Rows |> Seq.filter (fun (rw: AssetsInfo.Row) -> Set.contains

我有一些代码在第二次执行时生成异常,它是在FSI中执行的。顺序如下:

1) 选择它上面的所有行
,使用
Alt+Enter在
FSI
上运行

2) 选择代码,使用
Alt+Enter在
FSI
上运行。到目前为止没有错误

3) 点击
Alt+Enter
,再次运行所选代码。错误(见下文)

以下是生成此行为的代码行:

let assetsMap =
    assetInfo.Rows
    |> Seq.filter (fun (rw: AssetsInfo.Row) -> Set.contains rw.Ticker assetsTickerSet)
    |> List.ofSeq
    |> List.map (fun rw -> rw.Ticker, Asset.constructor rw) // Frame.ReadCSV called here
    |> Map.ofSeq
相关信息:

type AssetsInfo = FSharp.Data.CsvProvider<...> 
类型AssetInfo=FSharp.Data.CsvProvider
错误消息:

System.InvalidOperationException: tried to skip The input sequence has an insufficient number of elements. 1 past the end of the seq
   at Microsoft.FSharp.Collections.SeqModule.Skip@1316.GenerateNext(IEnumerable`1& next)
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
   at FSharp.Data.Runtime.CsvHelpers.parseIntoTypedRows@176.GenerateNext(IEnumerable`1& next) in C:\Git\FSharp.Data\src\Csv\CsvRuntime.fs:line 176
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.Internal.IEnumerator.next@187[T](FSharpFunc`2 f, IEnumerator`1 e, FSharpRef`1 started, Unit unitVar0)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.filter@182.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at <StartupCode$FSI_0035>.$FSI_0035.main@() in H:\Dropbox\BitBucket\VSProjects\Fractal10\Fractal10\Program.fs:line 139
Stopped due to error
System.InvalidOperationException:尝试跳过的输入序列的元素数不足。1超过序列的末尾
在Microsoft.FSharp.Collections.SeqModule上。Skip@1316.GenerateNext(IEnumerable`1和next)
在Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()中
在Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()中
在FSharp.Data.Runtime.CsvHelpers。parseIntoTypedRows@176.GenerateNextC:\Git\FSharp.Data\src\Csv\CsvRuntime.fs中的(IEnumerable`1&next):第176行
在Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()中
在Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()中
位于Microsoft.FSharp.Collections.Internal.IEnumerator。next@187[T] (FSharpFunc`2 f,IEnumerator`1 e,fsharpfref`1已启动,单元unitVar0)
位于Microsoft.FSharp.Collections.Internal.IEnumerator。filter@182.System-Collections-IEnumerator-MoveNext()
在Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1来源)
在H:\Dropbox\BitBucket\VSProjects\Fractal10\Fractal10\Program.fs中的.FSI_0035.main@()处:第139行
由于错误而停止

关于这种奇怪行为的原因有什么想法吗?

看起来像是类型提供程序中的一个bug。我同意;我建议在FSharp.Data项目中使用。@rmunn-我报告了它。