@@ -99,8 +99,15 @@ class Modifiable extends Declaration, @modifiable {
99
99
private predicate isReallyPrivate ( ) { this .isPrivate ( ) and not this .isProtected ( ) }
100
100
101
101
/**
102
- * Holds if this declaration is effectively `private` (either directly or
103
- * because one of the enclosing types is `private`).
102
+ * Holds if this declaration is effectively `private`. A declaration is considered
103
+ * effectively `private` if it can only be referenced from
104
+ * - the declaring and its nested types, similarly to `private` declarations, and
105
+ * - the enclosing types.
106
+ *
107
+ * Note that explicit interface implementation are also considered effectively
108
+ * `private` if the implemented interface is itself effectively `private`. Finally,
109
+ * `private protected` members are not considered effectively `private`, because
110
+ * they can be overriden within the declaring assembly.
104
111
*/
105
112
predicate isEffectivelyPrivate ( ) {
106
113
this .isReallyPrivate ( ) or
@@ -115,8 +122,14 @@ class Modifiable extends Declaration, @modifiable {
115
122
}
116
123
117
124
/**
118
- * Holds if this declaration is effectively `internal` (either directly or
119
- * because one of the enclosing types is `internal`).
125
+ * Holds if this declaration is effectively `internal`. A declaration is considered
126
+ * effectively `internal` if it can only be referenced from the declaring assembly.
127
+ *
128
+ * Note that friend assemblies declared in `InternalsVisibleToAttribute` are not
129
+ * considered. Explicit interface implementation are also considered effectively
130
+ * `internal` if the implemented interface is itself effectively `internal`. Finally,
131
+ * `internal protected` members are not considered effectively `internal`, because
132
+ * they can be overriden outside the declaring assembly.
120
133
*/
121
134
predicate isEffectivelyInternal ( ) {
122
135
this .isReallyInternal ( ) or
@@ -125,8 +138,8 @@ class Modifiable extends Declaration, @modifiable {
125
138
}
126
139
127
140
/**
128
- * Holds if this declaration is effectively `public`, because it
129
- * and all enclosing types are `public` .
141
+ * Holds if this declaration is effectively `public`, meaning that it can be
142
+ * referenced outside the declaring assembly .
130
143
*/
131
144
predicate isEffectivelyPublic ( ) { not isEffectivelyPrivate ( ) and not isEffectivelyInternal ( ) }
132
145
}
0 commit comments