Fix effective privateness of explicitly implemented members

This commit is contained in:
Tamas Vajk
2021-04-14 15:10:35 +02:00
parent a24006239b
commit f715445c7a
2 changed files with 10 additions and 2 deletions

View File

@@ -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,

View File

@@ -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 |