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

Protected member inaccessible #5302

Open
auduchinok opened this issue Jul 6, 2018 · 3 comments

Comments

@auduchinok
Copy link
Contributor

commented Jul 6, 2018

public class Base
{
    protected string Field;
}
type Inherited() =
    inherit Base()

    member x.Hey =
        let f () = x.Field
        f ()

screen shot 2018-07-07 at 01 14 10

This looks like intended behaviour, however the wording is misleading. In similar cases there's additional text about possible scope leaving.

@TIHan

This comment has been minimized.

Copy link
Collaborator

commented Jul 8, 2018

I'm able to reproduce. Looks like possible bug to me; I think you should be allowed to do this.

I can't say it's a bug now until we find out if this is desired behavior, so I'm marking as "Need More Info".

@TIHan TIHan added this to the 16.0 milestone Jul 8, 2018

@TIHan TIHan added Need More Info and removed bug labels Jul 8, 2018

@TIHan TIHan removed this from the 16.0 milestone Jul 8, 2018

@cartermp cartermp added this to the Unknown milestone Aug 30, 2018

@auduchinok

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2018

A workaround is to add public member that accesses the protected one. The need to use such a workaround seems odd for me.

@realvictorprm

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2019

@auduchinok can you maybe access it via base?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.