Skip to content

Any way to condition the return type of a method, based on the return value of another method? #8259

Answered by AndrolGenhald
rzvc asked this question in Q&A
Discussion options

You must be logged in to vote

Method calls can be asserted when memoizeMethodCallResults is true or when the methods are @psalm-mutation-free, but you can't call any possibly mutating methods between the has() call and the get() call: https://psalm.dev/r/e33bfb35a9

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rzvc
Comment options

@rzvc
Comment options

Answer selected by rzvc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants