AutoClose and Resource rehaul/cleanup
This PR simplifies the implementations of AutoCloseScope and ResourceScope and allows some of their functions to be inline. It also makes onRelease not suspending.
Kover Report
| Total Project Coverage | 57.90% |
|---|
Thanks for your work on making the DSL better, @kyay10. I really like everything which removes constraints from our DSLs, so if we can have suspend and non-suspend functions when before we had only the former, that's a huge win for me!
Having said so, we promised to keep source compatibility between 1.2.x and 2.0 (except for the changes in Optics KSP), and some of these changes break that source compatibility. I would really like to keep this promise: we've already broken code in the past, and I really want to make things right this time. This means that, at the very least, the same functions need to be exposed from the same package or class they originally were.
Going also in the direction pointed by @nomisRev, maybe this could be easier to review if the fundamental changes were broken from the refactoring changes. In general in Arrow we try to not refactor things like val to let style, or vice versa, and just keep the original author's code.
Closing in favour of #3518, mostly to provide a clean slate since it's been a while!