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

computed class const is considered mixed #2943

Closed
ro0NL opened this issue Mar 8, 2020 · 2 comments
Closed

computed class const is considered mixed #2943

ro0NL opened this issue Mar 8, 2020 · 2 comments
Labels

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Mar 8, 2020

https://psalm.dev/r/56ecd0849f

it seems for consts in the global scope it works as expected

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/56ecd0849f
<?php
const A = 1;
const B = 2;
const C = A | B;
    
function main(int $x): void {
    $x;
}

main(A);
main(C);

class x {
  public const A = 1;
  public const B = 2;
  public const C = self::A | self::B;
}

function main2(int $x): void {
    $x;
}

main2(x::A);
main2(x::C);
Psalm output (using commit 8926f1d):

INFO: MixedArgument - 24:7 - Argument 1 of main2 cannot be mixed, expecting int

@muglug muglug added the bug label Mar 9, 2020
@muglug
Copy link
Collaborator

muglug commented Mar 9, 2020

Fixed in 17afeae

@muglug muglug closed this as completed Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants