mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Fix effective privateness of explicitly implemented members
This commit is contained in:
@@ -102,7 +102,8 @@ class Modifiable extends Declaration, @modifiable {
|
||||
*/
|
||||
predicate isEffectivelyPrivate() {
|
||||
this.isPrivate() or
|
||||
this.getDeclaringType+().isPrivate()
|
||||
this.getDeclaringType+().isPrivate() or
|
||||
this.(Virtualizable).getExplicitlyImplementedInterface().isEffectivelyPrivate()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +112,8 @@ class Modifiable extends Declaration, @modifiable {
|
||||
*/
|
||||
predicate isEffectivelyInternal() {
|
||||
this.isInternal() or
|
||||
this.getDeclaringType+().isInternal()
|
||||
this.getDeclaringType+().isInternal() or
|
||||
this.(Virtualizable).getExplicitlyImplementedInterface().isInternal()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,6 +161,11 @@ class Virtualizable extends Member, @virtualizable {
|
||||
implementsExplicitInterface()
|
||||
}
|
||||
|
||||
override predicate isPrivate() {
|
||||
Member.super.isPrivate() and
|
||||
not implementsExplicitInterface()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any interface this member explicitly implements; this only applies
|
||||
* to members that can be declared on an interface, i.e. methods, properties,
|
||||
|
||||
@@ -26,3 +26,4 @@
|
||||
| Modifiers.cs:63:14:63:15 | M2 | public |
|
||||
| Modifiers.cs:68:14:68:15 | M1 | internal |
|
||||
| Modifiers.cs:71:18:71:19 | C2 | public |
|
||||
| Modifiers.cs:73:17:73:18 | M1 | internal |
|
||||
|
||||
Reference in New Issue
Block a user