Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Problems using FSI on multiple namespaces in a single file #237

Closed
isaacabraham opened this issue Feb 14, 2015 · 6 comments
Closed

Problems using FSI on multiple namespaces in a single file #237

isaacabraham opened this issue Feb 14, 2015 · 6 comments
Labels

Comments

@isaacabraham
Copy link
Contributor

Somewhat related to #44. The following single (valid) .fs file with the following two dependent namespaces will not compile in FSI:

namespace Foo
type Name = Name of string

namespace Bar
open Foo
type Person = Person of Name

with the error

Library1.fs(7,6): error FS0039: The namespace or module 'Foo' is not defined

There doesn't seem to be a workaround for this - with #44 you could work around it within the .fsx by manually adding open statements.

@latkin latkin added the Bug label Feb 15, 2015
@latkin
Copy link
Contributor

latkin commented Feb 15, 2015

To clarify - repro is to put the above code in code.fs, then #load it from code.fsx. I see this reproing back to F# 3.0

@isaacabraham
Copy link
Contributor Author

Yes, sorry, thanks for the clarification.

@isaacabraham
Copy link
Contributor Author

Hi - appreciate that there's other bugs out there that need squashing - just wondering if this one is penned in for fixing as part of the F#4 release? It's a real issue that is affecting is with a production system here in that we can't using .fsx files with our current codebase.

Not complaining if it's not - just wondering on how far up the priority list it is :-)

@latkin
Copy link
Contributor

latkin commented Mar 31, 2015

I don't think anyone is looking at this one with any higher priority than any others.

FWIW I have a really terrible workaround for you, which actually probably points to the root cause. Seems the fake FSI_**** namespace added in interactive sessions is not being properly ignored inter-file. If you are careful you can predict its value and compensate:

namespace Foo
type Name = Name of string

namespace Bar

#if INTERACTIVE
open FSI_0001.Foo
#else
open Foo
#endif

type Person = Person of Name

@dsyme
Copy link
Contributor

dsyme commented Apr 10, 2015

@isaacabraham - I've prepared a fix for this here: #359

@isaacabraham
Copy link
Contributor Author

Awesome :-) I was trying to work around that today so am looking forward to this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants