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:
parent
097e88a7cb
commit
586e8a157e
@ -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);
|
||||
|
||||
|
@ -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"];
|
||||
|
Loading…
Reference in New Issue
Block a user