Any thoughts on using context receivers in librari...
# library-development
m
Any thoughts on using context receivers in libraries implementations (not public API)? Is it safe to do or is there the possibility it will break in future releases?
1
👀 2
b
Not a confident answer, but it looks like there's no runtime/stdlib aspect that could potentially break in future kotlin versions, and it's strictly just extra parameters. Which should be fine. https://github.com/Kotlin/KEEP/blob/master/proposals/context-receivers.md#jvm-abi-and-java-compatibility But I have no clue if extra metadata would leak out (like if you have a public class with a private
context
method, would the class's @Metadata annotation leak any context receiver info that could potentially confuse a future library compilation? You could probably see how the metadata changes when you add/remove context from a private method to see if this is even a concern 🤷‍♂️
🙏 1