1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

qa: add test to verify backed enums are no literals

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing 2023-08-25 23:53:58 +02:00
parent 0160c469cd
commit 22bcd576d3
No known key found for this signature in database
GPG Key ID: 9A8988C93CEC81A3

View File

@ -1015,6 +1015,21 @@ class EnumTest extends TestCase
'ignored_issues' => [],
'php_version' => '8.1',
],
'backedEnumDoesNotPassNativeType' => [
'code' => '<?php
enum State: string
{
case A = "A";
case B = "B";
case C = "C";
}
function f(string $state): void {}
f(State::A);
',
'error_message' => 'InvalidArgument',
'ignored_issues' => [],
'php_version' => '8.1',
],
];
}
}