@@ -94,6 +94,22 @@ abstract class FunctionWithWrappers extends Function {
9494 )
9595 }
9696
97+ /**
98+ * Whether 'func' is a (possibly nested) wrapper function that feeds a parameter at the given index
99+ * through to an interesting parameter of 'this' function.
100+ *
101+ * The 'cause' gives the name of 'this' interesting function and its relevant parameter
102+ * at the end of the call chain.
103+ *
104+ * If there is more than one possible 'cause', a unique one is picked (by lexicographic order).
105+ */
106+ pragma [ nomagic]
107+ private string wrapperFunctionAnyDepthUnique ( Function func , int paramIndex ) {
108+ result =
109+ toCause ( func , paramIndex ) + ", which ends up calling " +
110+ min ( string targetCause | this .wrapperFunctionAnyDepth ( func , paramIndex , targetCause ) )
111+ }
112+
97113 /**
98114 * Whether 'func' is a (possibly nested) wrapper function that feeds a parameter at the given index
99115 * through to an interesting parameter of 'this' function.
@@ -114,13 +130,7 @@ abstract class FunctionWithWrappers extends Function {
114130 )
115131 or
116132 not this .wrapperFunctionLimitedDepth ( func , paramIndex , _, _) and
117- cause =
118- min ( string targetCause , string possibleCause |
119- this .wrapperFunctionAnyDepth ( func , paramIndex , targetCause ) and
120- possibleCause = toCause ( func , paramIndex ) + ", which ends up calling " + targetCause
121- |
122- possibleCause
123- )
133+ cause = wrapperFunctionAnyDepthUnique ( func , paramIndex )
124134 }
125135
126136 /**
0 commit comments