F# treating internal module as private

You'll need to give your modules a namespace so the internal module is visible to later ones.

let module internal MyNamespace.Module1
let module MyNamespace.Module2

Compiler bug

While the answers here are workarounds, this behavior is still a compiler bug. Reading the docs and Don Syme's Expert F#, there is no point that says that types in internal modules will be accessible only if you also use namespaces.

Considering the code the compiler emits I would not see a difficulty to make types inside internal modules visible inside the assembly.

Edit: Having filed this behavior to @fsbugs, the master himself, Don Syme, soon confirmed this being a bug. I added a workitem for this case:

https://visualfsharp.codeplex.com/workitem/29


this should be a namespace problem. Just add namespace definitions on top of both your files (the same namespace!) like this:

namespace MyNamespace

module internal Module1 =

let sample = 5+4

and

namespace MyNamespace

module Module2 =

let sample2 = 3 + Module1.sample