1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Fix #973 - allow types to reference other new types in a given docblock

This commit is contained in:
Matthew Brown 2018-09-04 22:27:55 -04:00
parent 7c274431f0
commit 84459286ac
2 changed files with 3 additions and 2 deletions

View File

@ -213,7 +213,7 @@ class CommentChecker
$type_string,
$aliases,
null,
$type_aliases
$type_alias_tokens + $type_aliases
);
} catch (TypeParseTreeException $e) {
throw new DocblockParseException($type_string . ' is not a valid type');

View File

@ -862,7 +862,8 @@ class AnnotationTest extends TestCase
'typeAliasBeforeFunction' => [
'<?php
/**
* @psalm-type CoolType = A|B|null
* @psalm-type A_OR_B = A|B
* @psalm-type CoolType = A_OR_B|null
* @return CoolType
*/
function foo() {