-
Notifications
You must be signed in to change notification settings - Fork 842
Closed
Labels
Description
When using #load preprocessor directives like #cd are ignored.
Repro steps
test.fsx
#cd "g"
#cd __SOURCE_FILE__
#load "other.fsx"
#cd __SOURCE_DIRECTORY__g/test.fsx/other.fsx
printfn "other.fsx"fsi#load "test.fsx"
Expected behavior
other.fsx
Actual behavior
test.fsx(3,1): error FS0079: Could not load file 'C:\PROJ\visualfsharp.issues\loadWithCd\other.fsx' because it does not exist or is inaccessible
Known workarounds
Currently none.
Related information
- Windows 10 x64
- I think all newer F# versions (at least latest FCS -> 4.1) and
fsibundled with Visual Studio 2015 Update 3 - Severity: Quite Annoying for Fake or tools using FSharp.Compiler.Service because they use
#loadbehind the scenes (https://github.com/fsharp/FSharp.Compiler.Service/blob/master/src/fsharp/fsi/fsi.fs#L2139)
Executing the file directly
fsi test.fsx
yields the expected output:
other.fsx
I used this originally because I cannot write something like
#load ("g/" + __SOURCE_FILE__ + "/other.fsx")