diff --git a/tests/PHPStan/Printer/PrinterTest.php b/tests/PHPStan/Printer/PrinterTest.php index 776873dd..cdd1640c 100644 --- a/tests/PHPStan/Printer/PrinterTest.php +++ b/tests/PHPStan/Printer/PrinterTest.php @@ -1385,6 +1385,27 @@ public function enterNode(Node $node) }, ]; + + yield [ + '/** @var ArrayObject */', + '/** @var ArrayObject> */', + new class extends AbstractNodeVisitor { + + public function enterNode(Node $node) + { + if ($node instanceof ArrayTypeNode) { + return new GenericTypeNode(new IdentifierTypeNode('array'), [ + new IdentifierTypeNode('int'), + ], [ + GenericTypeNode::VARIANCE_INVARIANT, + ]); + } + + return $node; + } + + }, + ]; } /**