Trivial F # code snippet does not work in MONO mode

Here is some code that won’t win rewards for complexity:

[<EntryPoint>]
let main argv =
   let i = 1I
   printfn "One is %A\n" i
   0 // return an integer exit code

It is compiled as follows: "c: / Program Files (x86) / Microsoft SDKs / F # / 3.0 / Framework / v4.0 / Fsc.exe" --out: numericstest.exe --debug: full --target: exe --standalone Program.fs

Windows creates the expected result. However, in Mono 3.0.7, compiled under Ubuntu, he says:

mono numericstest.exe

Unhandled Exception: System.InvalidProgramException: Invalid IL code in System.Numerics.BigInteger:get_One (): method body is empty.

at Program.main (System.String[] argv) [0x00000] in <filename unknown>:0[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in System.Numerics.BigInteger:get_One (): method body is empty.

at Program.main (System.String[] argv) [0x00000] in <filename unknown>:0

What am I doing wrong? Many thanks.

+5
source share
1 answer

- . , - System.Numerics.dll ; , (, Mono #), - , , , ..

, BigInteger ( I)?


Ubuntu (12.04, 32-) VM, VirtualBox. . , :

Compile/Run

jack@jack-linux:~/Desktop$ fsharpc --out:JoeHuha.exe --debug:full --target:exe --standalone JoeHuha.fs
F# Compiler for F# 3.0 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
jack@jack-linux:~/Desktop$ mono JoeHuha.exe
One is 1

jack@jack-linux:~/Desktop$ mono -V
Mono JIT compiler version 3.0.5 (master/1643364 Fri Feb 22 19:31:07 EST 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            Included Boehm (with typed GC and Parallel Mark)
+2

All Articles