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;
		}
	}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions