2

In the following code I can access the field a in Parent from Child via the member A:

type Parent () =
    let a = 5
    member _.A = a

type Child () =
    inherit Parent ()
    let b = base.A

This makes a accessible everywhere. Is there a way to make a accessible from inheriting classes like Child and its children, but otherwise private to Parent?

CarbonFlambe
  • 366
  • 1
  • 12
  • 2
    Seems like you're asking [Why isn't there a protected access modifier in F#?](https://stackoverflow.com/questions/2390515/why-isnt-there-a-protected-access-modifier-in-f) – OfirD Oct 07 '22 at 09:34

0 Answers0