Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Problems using FSI on a project #44

Closed
KevinRansom opened this issue Jan 18, 2015 · 0 comments
Closed

Problems using FSI on a project #44

KevinRansom opened this issue Jan 18, 2015 · 0 comments
Labels

Comments

@KevinRansom
Copy link
Member

Opened at CodePlex by ovatsus
[from https://github.com/fsharp/fsharp/issues/278](from fsharp/fsharp#278)

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 now 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.

@dsyme dsyme added Bug and removed suggestion labels Jan 20, 2015
dsyme added a commit to dsyme/fsharp that referenced this issue Jan 20, 2015
dsyme added a commit to dsyme/fsharp that referenced this issue Jan 20, 2015
@dsyme dsyme closed this as completed in 412e6e6 Jan 21, 2015
@latkin latkin added fixed and removed fix ready labels Jan 21, 2015
ncave pushed a commit to ncave/fsharp that referenced this issue Jan 26, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants