Closed ding-young closed 1 week ago
Haven't had a chance to look at this, but just wanted to say I'm intrigued and excited by the title and description!
@calebcartwright Thank you so much for your interest! I've actually posted a tracking issue (#6206) for this project, where you can follow along with updates and progress.
Background
Since current
rewrite
method cannot track the context , this pr plans to implementrewrite_result
method that returns Result. I will replacerewrite
withrewrite_result
in further pr.Detail
Added a default implementation of the
rewrite_result
method, which calls the existing rewrite method and transforms theOption
into aResult
with a default error kind. Additionally, I implemented therewrite_result
method for theChain
andast::Local
types by copying the body of their respective rewrite functions and replacing some of theOption
handling logic with appropriate error handling.TODO & Question