-
Notifications
You must be signed in to change notification settings - Fork 832
Description
It appears to be impossible to actually put a #r directive in a .fs file, at least as far as fsharpi on linux is concerned. Test case:
#if INTERACTIVE
#r "FParsec.dll"
#endif
module Test
let test =
5If I load this file with fsharpi It generates a FS0076:
~/Desktop/test.fs(2,1): error FS0076: #r directives may only occur in F# script files (extensions .fsx or .fsscript). Either move this code to a script file, add a '-r' compiler option for this reference or delimit the directive with '#if INTERACTIVE'/'#endif'.
Except as you can see, I followed those directions and it didn't fix it. I can't find any information about this on the web so this appears to be some sort of a bug in fsharpi. I've tried every permutation of this that I can think of and it just doesn't work. If you remove the #r directive, fsharpi happily loads and compiles the file.
The FS0076 guidance should be modified to remove the #if INTERACTIVE workaround if it's not intended to work. (I assume it's intended to work, though?)
Configuration details:
fsharpi --help prints F# Interactive for F# 3.0 (Open Source Edition).
Installed mono and fsharp from the mono-project package sources using the official directions (sudo apt-get install mono-complete fsharp).