You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a module (module A = ()) and a type (type A = { a : string }) have the same name a "Module" suffix is automatically added to the name of the module. This seems to only work if the type and the module are located in the same file.
Repro steps
Create a Project with two Files
Lib.fs
namespaceReprotypeA={ a:string }
Program.fs
namespaceRepromoduleA =()
Expected behavior
Compilation works and and a ModuleSuffix is added implicitly. This works when both types are declared in the same file.
Program.fs
namespaceReprotypeA={ a:string }moduleA =()
Actual behavior
Compilation fails with: Lib.fs(3, 6): [FS0250] A module and a type definition named 'A' occur in namespace 'Repro' in two parts of this assembly
Known workarounds
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] needs to be added manually.
The text was updated successfully, but these errors were encountered:
This is currently by design, though the RFC mentions a "compilation unit" instead of explicitly talking about per-file. I think this could be filed as a language suggestion here: https://github.com/fsharp/fslang-suggestions
When a module (
module A = ()
) and a type (type A = { a : string }
) have the same name a "Module" suffix is automatically added to the name of the module. This seems to only work if the type and the module are located in the same file.Repro steps
Create a Project with two Files
Lib.fs
Program.fs
Expected behavior
Compilation works and and a
ModuleSuffix
is added implicitly. This works when both types are declared in the same file.Program.fs
Actual behavior
Compilation fails with:
Lib.fs(3, 6): [FS0250] A module and a type definition named 'A' occur in namespace 'Repro' in two parts of this assembly
Known workarounds
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
needs to be added manually.The text was updated successfully, but these errors were encountered: