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

Const support more ops #4740

Merged
merged 1 commit into from
Nov 30, 2020
Merged

Const support more ops #4740

merged 1 commit into from
Nov 30, 2020

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Nov 29, 2020

This PR should solve #4739

@orklah
Copy link
Collaborator Author

orklah commented Nov 29, 2020

I'm quite confused.

First thing, seems like bitwise or is already working, but I don't see why yet, it doesn't seem to be handled where I am. Plus, I don't get why the other two bitwise operations are not supported the same way.

Second thing is that an union between TLiteralInt(0) and TPositiveInt seems to be displayed as int|positive-int. I'm pretty sure this issue was fixed not long ago (multiple int not merging), maybe this is more localized than I thought

Third thing is that I broke some attribute test. I'm not sure how

I'll continue checking those

@orklah
Copy link
Collaborator Author

orklah commented Nov 29, 2020

I think this should be ok now.

I changed a lot more than I thought I would:

  • Fixed arithmetic operations and tests for pow/exponent. The symbol is **, not ^
  • Added shift operations and some bitwise operations to arithmetics
  • Changed positive-int to int in tests. I'm pretty sure it's because those are LiteralInt being calculated in arithmetics.

@muglug muglug merged commit a760a24 into vimeo:master Nov 30, 2020
@muglug
Copy link
Collaborator

muglug commented Nov 30, 2020

Thanks, this is awesome!

danog pushed a commit to danog/psalm that referenced this pull request Jan 29, 2021
@orklah orklah deleted the const-support-more-ops branch September 14, 2021 17:38
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.

3 participants