AutoOpen externally defined module
Is there a way to AutoOpen an externally defined module? I'd like it to be available throughout a project without opening it in every file. Something like this would be ideal:
[<AutoOpen>]
module MyModule = YourNamespace.YourModule //ERROR: Ignoring attributes on module abbreviation
I tried this too, which would (hypothetically) make an externally defined module part of the public interface of a new module.
module MyModule =
mod开发者_JAVA技巧ule public YourModule = YourNamespace.YourModule //ERROR: Ignoring accessibility attribute on module abbreviation. Module abbreviations are always private.
That's a good question - it would make sense to allow this. Alternative would be to have some compiler argument to automatically open namespace/module, but I don't think there is one currently.
(There doesn't seem to be a better answer than what I wrote in the comment, so I copied it as an answer)
精彩评论