mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix #983 - allow more than two types to be intersected
This commit is contained in:
parent
4d676afaef
commit
bafd3cde1f
@ -396,6 +396,7 @@ class ParseTree
|
||||
}
|
||||
|
||||
if ($current_parent && $current_parent instanceof ParseTree\IntersectionTree) {
|
||||
$current_leaf = $current_parent;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ class TypeParseTest extends TestCase
|
||||
*/
|
||||
public function testIntersection()
|
||||
{
|
||||
$this->assertSame('I1&I2', (string) Type::parseString('I1&I2'));
|
||||
$this->assertSame('I1&I2&I3', (string) Type::parseString('I1&I2&I3'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,6 +170,14 @@ class TypeParseTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testIntersectionAfterGeneric()
|
||||
{
|
||||
$this->assertSame('Countable&iterable<int>&I', (string) Type::parseString('Countable&iterable<int>&I'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user