@@ -86,7 +86,7 @@ class Type extends @type {
86
86
tslit .includesType ( this )
87
87
) and
88
88
(
89
- not i . hasMethod ( _ , _ )
89
+ hasNoMethods ( i )
90
90
or
91
91
this .hasMethod ( getExampleMethodName ( i ) , _) and
92
92
forall ( string m , SignatureType t | i .hasMethod ( m , t ) | this .hasMethod ( m , t ) )
@@ -708,7 +708,7 @@ class TypeSetLiteralType extends @typesetliteraltype, CompositeType {
708
708
InterfaceType getInterfaceType ( ) {
709
709
this = result .getDirectlyEmbeddedTypeSetLiteral ( 0 ) and
710
710
not exists ( result .getDirectlyEmbeddedTypeSetLiteral ( 1 ) ) and
711
- not result . hasMethod ( _ , _ ) and
711
+ hasNoMethods ( result ) and
712
712
not exists ( result .getADirectlyEmbeddedInterface ( ) )
713
713
}
714
714
@@ -834,6 +834,10 @@ class InterfaceType extends @interfacetype, CompositeType {
834
834
override string toString ( ) { result = "interface type" }
835
835
}
836
836
837
+ // This predicate is needed for performance reasons.
838
+ pragma [ noinline]
839
+ private predicate hasNoMethods ( InterfaceType i ) { not i .hasMethod ( _, _) }
840
+
837
841
/**
838
842
* A basic interface type.
839
843
*
@@ -857,7 +861,7 @@ class BasicInterfaceType extends InterfaceType {
857
861
* `comparable`. This is done by extending `BasicInterfaceType`.
858
862
*/
859
863
class EmptyInterfaceType extends BasicInterfaceType {
860
- EmptyInterfaceType ( ) { not this . hasMethod ( _ , _ ) }
864
+ EmptyInterfaceType ( ) { hasNoMethods ( this ) }
861
865
}
862
866
863
867
/**
0 commit comments