mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Fix effective publicness of protected private and protected internal
This commit is contained in:
@@ -96,24 +96,32 @@ class Modifiable extends Declaration, @modifiable {
|
||||
/** Holds if this declaration is `async`. */
|
||||
predicate isAsync() { this.hasModifier("async") }
|
||||
|
||||
private predicate isReallyPrivate() { this.isPrivate() and not this.isProtected() }
|
||||
|
||||
/**
|
||||
* Holds if this declaration is effectively `private` (either directly or
|
||||
* because one of the enclosing types is `private`).
|
||||
*/
|
||||
predicate isEffectivelyPrivate() {
|
||||
this.isPrivate() or
|
||||
this.getDeclaringType+().isPrivate() or
|
||||
this.isReallyPrivate() or
|
||||
this.getDeclaringType+().(Modifiable).isReallyPrivate() or
|
||||
this.(Virtualizable).getExplicitlyImplementedInterface().isEffectivelyPrivate()
|
||||
}
|
||||
|
||||
private predicate isReallyInternal() {
|
||||
this.isInternal() and not this.isProtected()
|
||||
or
|
||||
this.isPrivate() and this.isProtected()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this declaration is effectively `internal` (either directly or
|
||||
* because one of the enclosing types is `internal`).
|
||||
*/
|
||||
predicate isEffectivelyInternal() {
|
||||
this.isInternal() or
|
||||
this.getDeclaringType+().isInternal() or
|
||||
this.(Virtualizable).getExplicitlyImplementedInterface().isInternal()
|
||||
this.isReallyInternal() or
|
||||
this.getDeclaringType+().(Modifiable).isReallyInternal() or
|
||||
this.(Virtualizable).getExplicitlyImplementedInterface().isEffectivelyInternal()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,3 +27,5 @@
|
||||
| Modifiers.cs:68:14:68:15 | M1 | internal |
|
||||
| Modifiers.cs:71:18:71:19 | C2 | public |
|
||||
| Modifiers.cs:73:17:73:18 | M1 | internal |
|
||||
| Modifiers.cs:75:32:75:33 | M2 | internal |
|
||||
| Modifiers.cs:76:33:76:34 | M3 | public |
|
||||
|
||||
Reference in New Issue
Block a user