-
Notifications
You must be signed in to change notification settings - Fork 789
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
F# allows same module names if in different namespaces, but not same file names even if in different folders #3231
Comments
Didn't we fix this already? |
related #2772 |
@forki I see the fix for that was merged in the 3rd of April. Did that change make it to the F#4.1 release? |
@knocte It will be in the 15.3 update, and is in the process of being integrated into the Mono 5.x series (which already contain F# 4.1, but not this fix) |
Thanks for the info, but what is 15.3 exactly? Is it a minor version number? F# 4.1.15.3? Where is that version number reflected? |
15.3 --> VS 2017 Update 3. VS 2017 is the 15th version of VS and how we refer to it internally. That leaks out into GitHub sometimes out of habit. |
ok thanks very much @cartermp |
This came up again. The error seemed to go away after closing the file, and reopening it, making a change, saving, undoing that change, and saving. The error re-appears if I save the abstract superclass So, I have:
and the |
When having module name clashes, namespacing is important.
For example, you have two modules named "Foo" in the same F# assembly. If you place them under namespaces Bar.Foo and Baz.Foo, the compiler is happy.
However, normally developers try to mimic directory-file name structures to map exactly with namespace-type ones. In this case, the F# compiler is not helping, because placing two Foo.fs for the same project, even if in different directories
Bar\Foo.fs
andBaz\Foo.fs
, it gives this error:Repro steps
Foo
: one namespacedBar.Foo
(BarFoo.fs) and the otherBaz.Foo
(BazFoo.fs).Bar
and rename the file toFoo.fs
.Baz
and rename the file toFoo.fs
.Expected behavior
F# compiler should succeed.
Actual behavior
error FS0239: An implementation of the file or module 'Foo' has already been given
Known workarounds
Rename files to redundant names such as BarFoo.fs and BazFoo.fs (even if they're already in Bar and Baz directories).
Related information
Provide any related information
The text was updated successfully, but these errors were encountered: