From the F# 4.0 spec [PDF]:
The CLI compiled form of all non-public entities is
internal
.
In my main project I have a function defined as
namespace MyNamespace.Foo
module Bar =
module Baz =
let private myFun ...
In the main project's ``AssemblyInfo.fs` I have
[<assembly: InternalsVisibleTo("MyNamespace.Tests")>]
(I've double-checked the name.)
However, in the test assembly (also F#), I get an error when referencing myFun
saying The value 'myFun' is not accessible from this code location.
Everything works fine if I remove private
from the definition of myFun
.
Strangely enough I am also able to call the private myFun
from a C# project even without InternalsVisibleTo
.
Why is the private myFun
not accessible from the test assembly when private
entities compile to internal
and I've specified InternalsVisibleTo
on the main assembly?