| 157248 | addCandidateThisType(usage, checker.getTypeAtLocation(declaration.parent)); |
| 157249 | } |
| 157250 | function removeLowPriorityInferences(inferences, priorities) { |
| 157251 | var toRemove = []; |
| 157252 | for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) { |
| 157253 | var i = inferences_1[_i]; |
| 157254 | for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) { |
| 157255 | var _b = priorities_1[_a], high = _b.high, low = _b.low; |
| 157256 | if (high(i)) { |
| 157257 | ts.Debug.assert(!low(i), "Priority can't have both low and high"); |
| 157258 | toRemove.push(low); |
| 157259 | } |
| 157260 | } |
| 157261 | } |
| 157262 | return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); }); |
| 157263 | } |
| 157264 | function combineFromUsage(usage) { |
| 157265 | return combineTypes(inferTypes(usage)); |
| 157266 | } |