fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Improve error message when module names clash in recursive module

Open cmeeren opened this issue 6 years ago • 1 comments

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

cmeeren avatar May 07 '19 13:05 cmeeren

IMO that message constitutes a bug, we should never emit that as a real message.

cartermp avatar May 13 '19 14:05 cartermp