mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Fix #973 - allow types to reference other new types in a given docblock
This commit is contained in:
parent
7c274431f0
commit
84459286ac
@ -213,7 +213,7 @@ class CommentChecker
|
|||||||
$type_string,
|
$type_string,
|
||||||
$aliases,
|
$aliases,
|
||||||
null,
|
null,
|
||||||
$type_aliases
|
$type_alias_tokens + $type_aliases
|
||||||
);
|
);
|
||||||
} catch (TypeParseTreeException $e) {
|
} catch (TypeParseTreeException $e) {
|
||||||
throw new DocblockParseException($type_string . ' is not a valid type');
|
throw new DocblockParseException($type_string . ' is not a valid type');
|
||||||
|
@ -862,7 +862,8 @@ class AnnotationTest extends TestCase
|
|||||||
'typeAliasBeforeFunction' => [
|
'typeAliasBeforeFunction' => [
|
||||||
'<?php
|
'<?php
|
||||||
/**
|
/**
|
||||||
* @psalm-type CoolType = A|B|null
|
* @psalm-type A_OR_B = A|B
|
||||||
|
* @psalm-type CoolType = A_OR_B|null
|
||||||
* @return CoolType
|
* @return CoolType
|
||||||
*/
|
*/
|
||||||
function foo() {
|
function foo() {
|
||||||
|
Loading…
Reference in New Issue
Block a user