Skip to content

Same file name across different folders fails the compilation with error FS0239  #2679

@et1975

Description

@et1975

"An implementation of the file or module '%s' has already been given"
coming from:
https://github.com/Microsoft/visualfsharp/blob/d2915e6ffa0d852cb3002199e66ef83bd2e8d1d0/src/fsharp/CompileOps.fs#L5221

File is not a module and perhaps the compiler should take into account the folder it is in.

Repro steps

Create a project and organize it using following folder structure:

/folder1/a.fs
/folder1/b.fs
/folder2/a.fs
/folder2/b.fs

This kind of organization is beneficial for modelling certain problems and having to maintain different file names is a burden.

Expected behavior

It should compile.

Actual behavior

Even if the modules/namespaces defined by these files are different the compilation will still fail with FS0239

Known workarounds

Rename the files.

Related information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions