1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Fix #1875 - improve printing of iterable type

This commit is contained in:
Matthew Brown 2019-06-29 21:46:01 -04:00
parent ca53019d6b
commit 62fb86aef0
2 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class TIterable extends Atomic
{
$s = '';
foreach ($this->type_params as $type_param) {
$s .= $type_param->getKey() . ', ';
$s .= $type_param->getId() . ', ';
}
$extra_types = '';

View File

@ -216,6 +216,11 @@ class TypeParseTest extends TestCase
$this->assertSame('iterable<mixed, A>&iterable<mixed, B>', (string) Type::parseString('iterable<A>&iterable<B>'));
}
public function testIterableContainingObjectLike()
{
$this->assertSame('iterable<string, array{0: int}>', Type::parseString('iterable<string, array{int}>')->getId());
}
/**
* @return void
*/