mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Prevent TypeParseException when dealing with nested template in assertion
This commit is contained in:
parent
7b24552534
commit
196f24aac3
@ -510,7 +510,9 @@ class FunctionLikeDocblockScanner
|
||||
$self_fqcln,
|
||||
null,
|
||||
true
|
||||
)
|
||||
),
|
||||
null,
|
||||
$function_template_types + $class_template_types
|
||||
);
|
||||
} catch (TypeParseTreeException $e) {
|
||||
$storage->docblock_issues[] = new InvalidDocblock(
|
||||
|
@ -767,6 +767,17 @@ class FunctionTemplateAssertTest extends TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'noCrashWhenAssertingTemplatedKeyOf' => [
|
||||
'<?php
|
||||
/**
|
||||
* @template TArray as array
|
||||
* @template TCandidateKey as array-key
|
||||
* @param TArray $arr
|
||||
* @param array-key $key
|
||||
* @psalm-assert key-of<TArray> $key
|
||||
*/
|
||||
function keyExists(array $arr, $key) : void {}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user