https://github.com/bulbazord commented:

I like the idea of this PR (big fan of `llvm::Expected`) but the way this is 
implemented contains an anti-pattern IMO. Specifically, all callers consume the 
error from `ExtractIndexFromString` only to then create a similar but different 
error string afterwards. It would be great if the callers could just propagate 
the error from `ExtractIndexFromString` instead of doing this dance.

Perhaps `ExtractIndexFromString` could return the error string `Type has no 
child named '%s'` and the function could be named something more descriptive? 
Something like `ExtractIndexOfChildFromString`?

https://github.com/llvm/llvm-project/pull/138297
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to