mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix #3529 - static intersected with itself is static
This commit is contained in:
parent
ce445636e7
commit
3d7288afcb
@ -492,6 +492,10 @@ class TypeParser
|
||||
$intersect_static = true;
|
||||
}
|
||||
|
||||
if (!$keyed_intersection_types && $intersect_static) {
|
||||
return new TNamedObject('static');
|
||||
}
|
||||
|
||||
$first_type = array_shift($keyed_intersection_types);
|
||||
|
||||
if ($intersect_static
|
||||
|
@ -189,6 +189,14 @@ class TypeParseTest extends TestCase
|
||||
$this->assertSame('Iterator<mixed, int>&Traversable', (string) Type::parseString('Iterator<int>&Traversable'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testStaticAndStatic()
|
||||
{
|
||||
$this->assertSame('static', (string) Type::parseString('static&static'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user