Let's say we have an F# project consistent of two files (this is the minimum to be able reproduce this):
File A.fs:
namespace Project
type DU = A | B
File B.fs:
namespace Project
type B = { Prop : DU }
This compiles fine. If you know want to test this on a script file:
#load "A.fs"
#load "B.fs"
If you evaluate this, you'l get this error:
[Loading c:\users\guguer\documents\visual studio 2013\Projects\ConsoleApplication2\A.fs]
namespace FSI_0002.Project
type DU =
| A
| B
>
[Loading c:\users\guguer\documents\visual studio 2013\Projects\ConsoleApplication2\B.fs]
B.fs(3,19): error FS0039: The type 'DU' is not defined
>
There is a workaround, which is to include open Project on B.fs, but it's not obvious. On big projects, and for new users, this is a stumbling block that makes things look broken.
Similar issues happen with modules instead of namespaces.
I don't know if this is a bug or by design, but it's a severe obstacle to testing things in FSI. Can we get this fixed?
Let's say we have an F# project consistent of two files (this is the minimum to be able reproduce this):
File A.fs:
File B.fs:
This compiles fine. If you know want to test this on a script file:
If you evaluate this, you'l get this error:
There is a workaround, which is to include
open Projecton B.fs, but it's not obvious. On big projects, and for new users, this is a stumbling block that makes things look broken.Similar issues happen with modules instead of namespaces.
I don't know if this is a bug or by design, but it's a severe obstacle to testing things in FSI. Can we get this fixed?