1

我有这个代码Yoghurt.Fruit.fs

module Yoghurt.Fruit
 open FSharp.Data
 type Fruit = JsonProvider<"fruit.json">
 let fruit = Fruit.Load("fruit.json")
 let fruitExists name = fruit.Callouts |> Array.exists (fun el -> el.Name = name)

我在 OSX 中使用 Mono 运行这个编译命令 fsharpc --nologo -r ../../fsharp-lib/Fhsarp.Data/FSharp.Data.dll Yoghurt.Fruit.fs -a -o:bin/Yoghurt.Fruit.dll

我收到这个错误

* Assertion at threads.c:1360, condition 'internal' not met

Illegal instruction: 4

(nb first ' 在 internal 之前实际上是 ` 在这里编辑以进行格式化)

我不知道这个错误意味着什么以及为什么我得到它。我有一组.fs以这种方式编译的文件(对它们运行测试 - 然后最后在一个.fsx文件中使用它们)。在主.fsx文件中我有这个代码

#r "/Users/philharvey/Documents/code/fsharp/fsharp-lib/Fhsarp.Data/FSharp.Data.dll"
open FSharp.Data
type Fruit = JsonProvider<"fruit.json">
let fruit = Fruit.Load("fruit.json")
let fruitExists name = fruit.Callouts |> Array.exists (fun el -> el.Name = name)

这很好用。我真的很想将此代码提取到一个模块中进行单独测试(除了fruitExists我没有列出的其他功能,因为我已经将我的问题归结为这个)。

任何人有任何见解?

编辑

的结果mono -V

Mono JIT compiler version 3.0.10 ((no/eff4cb5 Sat Apr 13 19:24:30 EDT 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug
    LLVM:          yes(3.2svn-mono)
    GC:            Included Boehm (with typed GC)

fsharpcF# Compiler for F# 3.0 (Open Source Edition)

(对于额外的信息,我正在使用它进行测试Mono.framework/Versions/3.0.10/bin/nunit-console4

编辑 2

FSharp.Data Version 1.1.5

编辑 3

更多信息:我刚刚测试.fsxfsharpifsharpc使用JsonProvider上述方法。它可以通过fsharpi但不能fsharpc(给出与上面相同的错误)。我还使用此处http://blogs.msdn.com/b/fsharpteam/archive/2011/07/30/f-console-application-template.aspxfsharpc的模板(基本)进行了测试。使用类型提供程序时给出相同的错误。

4

1 回答 1

0

我刚刚升级到mono 3.2.1并确保我使用的是最新版本F# 1.1.9并且问题已经消失。

于 2013-08-26T20:26:17.463 回答