1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Fix tests with loose types. Fix return type in the reconciler.

This commit is contained in:
Alexandr Zolotukhin 2021-08-03 19:34:35 +03:00
parent 097e88a7cb
commit 586e8a157e
2 changed files with 3 additions and 3 deletions

View File

@ -1483,7 +1483,7 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
Codebase $codebase,
Union $existing_var_type,
string $assertion
) : Union {
) : ?Union {
if (strpos($assertion, '::')) {
[$fq_classlike_name, $const_name] = explode('::', $assertion);

View File

@ -794,7 +794,7 @@ class ValueTest extends \Psalm\Tests\TestCase
'returnFromUnionLiteral' => [
'<?php
/**
* @return list<"a1"|"a2">
* @return array{"a1", "a2"}
*/
function getSupportedConsts() {
return ["a1", "a2"];
@ -814,7 +814,7 @@ class ValueTest extends \Psalm\Tests\TestCase
'returnFromUnionLiteralNegated' => [
'<?php
/**
* @return list<"a1"|"a2">
* @return array{"a1", "a2"}
*/
function getSupportedConsts() {
return ["a1", "a2"];