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:
parent
7c274431f0
commit
84459286ac
@ -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');
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user