File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1064,10 +1064,19 @@ class ErrorType extends Type {
1064
1064
ErrorType ( ) { this .implements ( Builtin:: error ( ) .getType ( ) .getUnderlyingType ( ) ) }
1065
1065
}
1066
1066
1067
+ /**
1068
+ * Gets the number of types with method `name`.
1069
+ */
1070
+ bindingset [ name]
1071
+ int numberOfTypesWithMethodName ( string name ) { result = count ( Type t | t .hasMethod ( name , _) ) }
1072
+
1067
1073
/**
1068
1074
* Gets the name of a method in the method set of `i`.
1069
1075
*
1070
1076
* This is used to restrict the set of interfaces to consider in the definition of `implements`,
1071
- * so it does not matter which method name is chosen (we use the lexicographically least).
1077
+ * so it does not matter which method name is chosen (we use the most unusual name the interface
1078
+ * require; this is the most discriminating and so shrinks the search space the most).
1072
1079
*/
1073
- private string getExampleMethodName ( InterfaceType i ) { result = min ( string m | i .hasMethod ( m , _) ) }
1080
+ private string getExampleMethodName ( InterfaceType i ) {
1081
+ result = min ( string m | i .hasMethod ( m , _) | m order by numberOfTypesWithMethodName ( m ) )
1082
+ }
You can’t perform that action at this time.
0 commit comments