I have this code in 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)
I am running this compile command in OSX with Mono
fsharpc --nologo -r ../../fsharp-lib/Fhsarp.Data/FSharp.Data.dll Yoghurt.Fruit.fs -a -o:bin/Yoghurt.Fruit.dll
I get this error
* Assertion at threads.c:1360, condition 'internal' not met
Illegal instruction: 4
(nb first ' before internal is actually ` edited here for formatting)
I have no idea what this error means and why I am getting it. I have a collection of .fs
files that I am compiling in this way (to run tests against them - and then finally use them all in a .fsx
file). In the main .fsx
file I have this code
#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)
and this works just fine. I would really like to pull out this code into a module to be separately tested (there is other functionality besides fruitExists
that I haven't listed because I have boiled my problem down to this).
Anyone have any insight?
Edit
result of 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)
fsharpc
gives F# Compiler for F# 3.0 (Open Source Edition)
(and for extra info I am using this for tests Mono.framework/Versions/3.0.10/bin/nunit-console4
Edit 2
FSharp.Data Version 1.1.5
Edit 3
More information: I have just tested an .fsx
through fsharpi
and fsharpc
using the JsonProvider
as above. It works through fsharpi
but not fsharpc
(gives the same error above). I have also done a test with fsharpc
using the template (basic) from here http://blogs.msdn.com/b/fsharpteam/archive/2011/07/30/f-console-application-template.aspx. Gives the same error when the type provider is used.
I have just upgraded to mono 3.2.1
and made sure I am on latest version of F# 1.1.9
and the problem has gone away.