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

Checks the intersection type if the magic method does not exist #5473

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

jni-
Copy link
Contributor

@jni- jni- commented Mar 24, 2021

The original issue we had was with the type S3Client & MockObject. Since S3Client has magic methods, calling MockObject methods on it (->expects, ->method, etc) was failing. Using MockObject & S3Client would work, because the method is detected on MockObject before checking S3Client. However, an intersection type should still check both, and the order should not matter (I think).

I think the issue is that when a magic method was detected as missing, it would stop analysis and not validate union or intersection types. The tests I added replicate the problem well, however my confidence in how I fixed it is about 10%. I would need help to validate the solution, I did this in about 15 minutes and didn't understand all the implications. At least it's a starting point!

Thanks!

@jni- jni- force-pushed the fix_magic_method_intersection branch from ab07d14 to aea46fe Compare March 24, 2021 14:54
@muglug muglug merged commit 30f64b7 into vimeo:master Mar 24, 2021
@muglug
Copy link
Collaborator

muglug commented Mar 24, 2021

Thanks! Generally if it passes tests, I'm happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants