mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Allow empty-string in first position of an type (#5814)
This commit is contained in:
parent
6a61298074
commit
c69cf9a849
@ -279,7 +279,7 @@ class CommentAnalyzer
|
||||
$last_char = $i > 0 ? $return_block[$i - 1] : null;
|
||||
|
||||
if ($quote_char) {
|
||||
if ($char === $quote_char && $i > 1 && !$escaped) {
|
||||
if ($char === $quote_char && !$escaped) {
|
||||
$quote_char = null;
|
||||
|
||||
$type .= $char;
|
||||
|
@ -1201,6 +1201,15 @@ class AnnotationTest extends TestCase
|
||||
|
||||
takesFlags(FileFlag::MODIFIED | FileFlag::NEW);'
|
||||
],
|
||||
'emptyStringFirst' => [
|
||||
'<?php
|
||||
/**
|
||||
* @param \'\'|\'a\'|\'b\' $v
|
||||
*/
|
||||
function testBad(string $v): void {
|
||||
echo $v;
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user