Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Problems using FSI on a project #278

Description

@ovatsus

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions