@@ -127,6 +127,8 @@ private module Input1 implements InputSig1<Location> {
127127 tp0 order by kind , id1 , id2
128128 )
129129 }
130+
131+ int getTypePathLimit ( ) { result = 10 }
130132}
131133
132134private import Input1
@@ -135,6 +137,8 @@ private module M1 = Make1<Location, Input1>;
135137
136138private import M1
137139
140+ predicate getTypePathLimit = Input1:: getTypePathLimit / 0 ;
141+
138142class TypePath = M1:: TypePath ;
139143
140144module TypePath = M1:: TypePath;
@@ -2265,6 +2269,16 @@ private module Debug {
22652269 result = strictcount ( Type t0 | t0 = inferType ( n , path ) )
22662270 }
22672271
2272+ Type debugInferTypeForNodeAtLimit ( AstNode n , TypePath path ) {
2273+ result = inferType ( n , path ) and
2274+ exists ( TypePath path0 | exists ( inferType ( n , path0 ) ) and path0 .length ( ) >= getTypePathLimit ( ) )
2275+ }
2276+
2277+ predicate countTypesForNodeAtLimit ( AstNode n , int c ) {
2278+ n = getRelevantLocatable ( ) and
2279+ c = strictcount ( Type t , TypePath path | t = debugInferTypeForNodeAtLimit ( n , path ) )
2280+ }
2281+
22682282 predicate maxTypes ( AstNode n , TypePath path , Type t , int c ) {
22692283 c = countTypesAtPath ( n , path , t ) and
22702284 c = max ( countTypesAtPath ( _, _, _) )
0 commit comments