Skip to content

Module marked with ModuleSuffix attribute is hidden by another module with the same name #3565

Description

@vasily-kirichenko

If a project contains two modules with the same name, one of which is marked with ModuleSuffix attribute:

// Foo1.fs
namespace Library

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
module Foo =
    let bar x = x
// 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:

image

image

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):

namespace Library
{
	[CompilationMapping(SourceConstructFlags.Module)]
	public static class Foo
	{
		public static a buzz<a>(a x)
		{
			return x;
		}
	}
}

namespace Library
{
	[CompilationMapping(SourceConstructFlags.Module), CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)]
	public static class FooModule
	{
		public static a bar<a>(a x)
		{
			return x;
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions