Skip to content

Improve error message when module names clash in recursive module #6694

@cmeeren

Description

@cmeeren

If a recursive module contains two modules with the same name, VS doesn't show any errors, and compilation fails with a somewhat unhelpful error message.

Repro steps

module rec A

module Foobar = ()

module Foobar = ()

Expected behavior

I get the same error message as when I do this in a non-recursive module:

FS0037 Duplicate definition of type, exception or module 'Foobar'

Actual behavior

I get no IDE errors, and compilation fails with this error message:

FSC : error FS2014: A problem occurred writing the binary 'C:\Path\To\MyProject\obj\Debug\netcoreapp2.2\MyAssembly.dll': duplicate entry 'Foobar' in type index table

Related information

  • VS 16.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Diagnosticsmistakes and possible improvements to diagnosticsBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    No fields configured for Bug.

    Projects

    Status
    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions