@@ -493,6 +493,9 @@ class MemberDeclaration extends @property, Documentable {
493
493
*/
494
494
predicate isStatic ( ) { is_static ( this ) }
495
495
496
+ /** Gets a boolean indicating if this member is static. */
497
+ boolean getStaticAsBool ( ) { if isStatic ( ) then result = true else result = false }
498
+
496
499
/**
497
500
* Holds if this member is abstract.
498
501
*
@@ -694,10 +697,10 @@ class MethodDeclaration extends MemberDeclaration {
694
697
* the overload index is defined as if only one of them was concrete.
695
698
*/
696
699
int getOverloadIndex ( ) {
697
- exists ( ClassOrInterface type , string name |
700
+ exists ( ClassOrInterface type , string name , boolean static |
698
701
this =
699
702
rank [ result + 1 ] ( MethodDeclaration method , int i |
700
- methodDeclaredInType ( type , name , i , method )
703
+ methodDeclaredInType ( type , name , static , i , method )
701
704
|
702
705
method order by i
703
706
)
@@ -718,10 +721,11 @@ class MethodDeclaration extends MemberDeclaration {
718
721
* Holds if the `index`th member of `type` is `method`, which has the given `name`.
719
722
*/
720
723
private predicate methodDeclaredInType (
721
- ClassOrInterface type , string name , int index , MethodDeclaration method
724
+ ClassOrInterface type , string name , boolean static , int index , MethodDeclaration method
722
725
) {
723
726
not method instanceof ConstructorDeclaration and // distinguish methods named "constructor" from the constructor
724
727
type .getMemberByIndex ( index ) = method and
728
+ static = method .getStaticAsBool ( ) and
725
729
method .getName ( ) = name
726
730
}
727
731
0 commit comments