Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An accessibility compilation error when a public type implements an internal interface that uses an internal type #557

Closed
zealisland opened this issue Jul 25, 2015 · 1 comment
Labels
Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.

Comments

@zealisland
Copy link

The detail is at http://stackoverflow.com/questions/31598422/on-an-accessibility-compilation-error-when-a-public-type-implements-an-internal, is this a compiler bug or by design? If it's by design, please comment/answer at the stackoverflow thread.

@latkin
Copy link
Contributor

latkin commented Jul 27, 2015

So that others don't need to visit the link, the question is why there is an error in this case:

type internal Foo() = class end

type internal IMyInterface =
    abstract member Method1 : Foo -> unit

type Class1() =
    interface IMyInterface with
        // error FS0410: The type 'Foo' is less accessible than
        //  the value, member or type 'override Class1.Method1 : v:Foo -> unit' it is used in
        member this.Method1(v : Foo) = ()

Seems like a simple oversight for a slightly edge case. It's only valid when the interface is implemented explicitly, however that's the F# default so in theory this should be legal.

I don't see this covered explicitly in the language spec (I might be missing it though) so I'll mark as a bug for now.

@latkin latkin added the Bug label Jul 27, 2015
@latkin latkin added this to the F# 4.0 Update 1 milestone Aug 4, 2015
@dsyme dsyme added Area-Compiler Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels Jan 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
None yet
Development

No branches or pull requests

5 participants