Module marked with ModuleSuffix attribute is hidden by another module with the same name
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
If a project contains two modules with the same name, one of which is marked with `ModuleSuffix` attribute:
```fsharp
// Foo1.fs
namespace Library
[]
module Foo =
let bar x = x
```
```fsharp
// Foo2.fs
module Library.Foo
let buzz x = x
```
symbols defined in the marked with `ModuleSuffix` attribute one are not seen in projects referencing this one:


The bug (feature?) was found while moving ExtCore library to .NET Standard 2.0
Minimal repro https://github.com/vasily-kirichenko/TwoModulesBug
It's compiled to (ILSpy):
```csharp
namespace Library
{
[CompilationMapping(SourceConstructFlags.Module)]
public static class Foo
{
public static a buzz(a x)
{
return x;
}
}
}
namespace Library
{
[CompilationMapping(SourceConstructFlags.Module), CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)]
public static class FooModule
{
public static a bar(a x)
{
return x;
}
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.