Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow calling mutation_free function inside a mutation_free context #7253

Merged
merged 2 commits into from Dec 30, 2021

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Dec 30, 2021

This should fix #5874

I'm pretty lost however on all the annotations of purity/mutability that exists, which can be applied on which symbols and which annotation can be called inside which one.

For example, :

  • pure can only be annotated on a method/function
  • immutable can be annotated on a class
  • you can call pure functions in immutable scope
  • can you call external-mutation-free class inside an immutable scope?

It'd be great if someone could take the time to revamp the part of the doc that talks about all those: https://psalm.dev/docs/annotating_code/supported_annotations/#psalm-mutation-free

To explain the interactions between them. I'm pretty sure there are a lot of places with similar issues that I fixed here, partly because it's not very transparent what goes into what.

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Dec 30, 2021
@orklah orklah merged commit 51ba96c into vimeo:master Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calls to mutation-free functions in a mutation-free context should be allowed
1 participant