1

If I create a new F# file 'Test.fsx' in VSCode with the line

#I __SOURCE_DIRECTORY__

attempting to run the code in FSI generates the error

Test.fsx(2,4): error FS0010: Unexpected compiler generated literal in interaction. Expected incomplete structured construct at or before this point, ';', ';;' or other token.

Any idea what might be going wrong?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
roboleek
  • 11
  • 2
  • You're just trying to reference a package in the same directory as `Test.fsx`? – LSM07 Jul 21 '21 at 12:59
  • Yes, that's right. It also generates the same error in Visual Studio. – roboleek Jul 21 '21 at 15:11
  • Check this and see if it works for you: https://fsharpforfunandprofit.com/posts/property-based-testing/#using-fscheck-to-test-the-addition-properties Also, if you're already in the same directory, you might be able to just `#r` or `#load` the files/assemblies you need. – LSM07 Jul 22 '21 at 15:14

1 Answers1

0

It is a known issue in VS2019, which has been fixed in VS2022.

https://github.com/dotnet/fsharp/issues/13467

You may replace the code with

#I "."
smoothdeveloper
  • 1,972
  • 18
  • 19