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

Simple arithmetic doesn't seem to work #5722

Closed
danog opened this issue May 5, 2021 · 4 comments
Closed

Simple arithmetic doesn't seem to work #5722

danog opened this issue May 5, 2021 · 4 comments

Comments

@danog
Copy link
Collaborator

danog commented May 5, 2021

https://psalm.dev/r/0ac047d8fc

@psalm-github-bot
Copy link

psalm-github-bot bot commented May 5, 2021

I found these snippets:

https://psalm.dev/r/0ac047d8fc
<?php
$a = 0;
$b = $a + 1;
/** @psalm-trace $a */;
/** @psalm-trace $b */;
Psalm output (using commit 9e19653):

INFO: Trace - 4:23 - $a: 0

INFO: Trace - 5:23 - $b: positive-int

INFO: UnusedVariable - 2:1 - $a is never referenced or the value is not used

INFO: UnusedVariable - 3:1 - $b is never referenced or the value is not used

@weirdan
Copy link
Collaborator

weirdan commented May 5, 2021

did you expect $b: 1?

@danog
Copy link
Collaborator Author

danog commented May 5, 2021

Yep, exactly :)
Noticed this while fixing tests for #5723))

@orklah
Copy link
Collaborator

orklah commented Oct 12, 2021

This was fixed

@orklah orklah closed this as completed Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants