Join Slack
Powered by
Can I make `xPath` and `contextString` private?
# announcements
o
Onur
08/06/2019, 2:37 PM
Can I make
xPath
and
contextString
private?
d
diesieben07
08/06/2019, 2:38 PM
No, you cannot lower the visibility of inherited / overridden members. That would violate the liskov substitution principle
r
Ruckus
08/06/2019, 2:39 PM
Even if you were able to mark it as private in
ExistingLinkMatch
, you could just cast it to
Match
and access it.
o
Onur
08/06/2019, 2:42 PM
I see, thanks
a
Animesh Sahu
08/06/2019, 2:56 PM
If those variables are defined as val in the Match() interface then you can modify and make them private and can change immutability to var as well.
10
Views
Open in Slack
Previous
Next