-
Notifications
You must be signed in to change notification settings - Fork 672
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
Fix enum crash #10643
Fix enum crash #10643
Conversation
Does https://psalm.dev/r/38dc5a68ea (referencing the enum below rather than above) work with your PR? |
I found these snippets: https://psalm.dev/r/38dc5a68ea<?php declare(strict_types=1);
enum AnotherEnum: string
{
case ANOTHER_VALUE = SomeEnum::SOME_VALUE->value;
}
enum SomeEnum: string
{
case SOME_VALUE = 'SOME_VALUE';
}
|
No, that still fails. Looks like the I can look into it, but probably not before monday. |
I found these snippets: https://psalm.dev/r/5d409f074e<?php
declare(strict_types=1);
class Foo
{
public const BAR = Baz::QUX;
}
class Baz
{
public const QUX = 123;
}
/** @psalm-trace $x */
$x = Foo::BAR;
echo $x;
|
Resolves a number of long-standing bugs ('Failed to infer case value ...') Fixes vimeo#10374 Fixes vimeo#10560 Fixes vimeo#10643 Fixes vimeo#8978
Resolves a number of long-standing bugs ('Failed to infer case value ...') Fixes vimeo#10374 Fixes vimeo#10560 Fixes vimeo#10643 Fixes vimeo#8978
Resolves a number of long-standing bugs ('Failed to infer case value ...') Fixes vimeo#10374 Fixes vimeo#10560 Fixes vimeo#10643 Fixes vimeo#8978
No, that PR addresses the issue you were trying to fix in a more general way. |
Fixes #10560.
First commit fixes the crash.
Second commit fixes the
InvalidEnumCaseValue
revealed once the crashing is fixed.Third commit adds two test cases for the crash fix.
I'd like to add some more test cases to validate the value is resolved correctly, but not sure where.