Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Alternative fix for #6909: Use @cached annotation #6967
Instead of memo, have a @cached annotation. Usage example:
Use the same logic for caching given aliases
dotty-bot left a comment
Hello, and thank you for opening this PR!
All contributors have signed the CLA, thank you!
We want to keep history, but for that to actually be useful we have
Please stick to these guidelines for commit messages:
Have an awesome day!
In light of the progress made with the lazy vals design in #6979, it seems safer and more systematic to just use a lazy val for caching given instances.
That leaves the question whether @cached in its present form should be made available as a macro. I am not sure about that anymore. It does not seem to belong in the language spec. The compiler will have some usage for @cached but it's not clear it's enough to warrant the expense of having to implement it.