Foreverstack: `resolve_path` should return expected instead
resolve_path returns an optional however we miss some context: which segment cannot be resolved.
otpionalrib::Definition -> expected<rib::Definition, Error(Segment locus)>
I tried that a while back -- quickly turns into a mess
I tried that a while back -- quickly turns into a mess
Yeah, I'm currently dealing with that and it's not pretty. I think it is mandatory if we want to indicate the exact failure location and provide great error messages to the user.
I added a vector-by-reference parameter to store Errors -- you could always create a new class to store errors, that could be translated into instances of Error, and use that.
@powerboat9 still a draft but you can take a look at 9ac02058a9c1e6ab2a04e466eb92f135e8a052ca. I'll tackle migration from your error vector next. Do you have any other information that would be worth reading ?
resolve_path might error out for reasons other than failure to resolve a segment -- say, too many leading super segments. Also, are you sure resolve_path can't produce multiple errors? I can't come up with any counterexamples though, so it's probably fine.