fsharp
fsharp copied to clipboard
Improve error message when module names clash in recursive module
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
IMO that message constitutes a bug, we should never emit that as a real message.