Fix isEffectively* predicates to members extracted from multiple assemblies

This commit is contained in:
Tamas Vajk
2021-06-15 16:19:46 +02:00
parent 77f8f3fa8a
commit db8a777aa9

View File

@@ -96,7 +96,12 @@ 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() }
private predicate isReallyPrivate() {
this.isPrivate() and
not this.isProtected() and
// Rare case when a member is defined with the same name in multiple assemblies with different visibility
not this.isPublic()
}
/**
* Holds if this declaration is effectively `private`. A declaration is considered
@@ -116,9 +121,13 @@ class Modifiable extends Declaration, @modifiable {
}
private predicate isReallyInternal() {
this.isInternal() and not this.isProtected()
or
this.isPrivate() and this.isProtected()
(
this.isInternal() and not this.isProtected()
or
this.isPrivate() and this.isProtected()
) and
// Rare case when a member is defined with the same name in multiple assemblies with different visibility
not this.isPublic()
}
/**