Predicates: add visitor for typed predicates
Created by: camdencheek
This adds a visitor that yields typed predicates. We can do this because each predicate type is self-describing: it knows its own parent field, it knows its own name, and it knows how to unmarshal its own args. This was kinda what I had in mind all along, but the lack of generics made it infeasible.
For now, it's called VisitTypedPredicate
, but I'll probably replaces uses of VisitPredicate
over time and rename this VisitPredicate
.
Test plan
Added test for RepoContainsFile
, which is the only place that uses it right now.