mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #976 - make sure misplaced { doesn’t halt execution
This commit is contained in:
parent
3e920b1227
commit
44c742c849
@ -314,7 +314,7 @@ abstract class Type
|
||||
}
|
||||
|
||||
if ($type !== 'array') {
|
||||
throw new \InvalidArgumentException('Object-like type must be array');
|
||||
throw new TypeParseTreeException('Unexpected brace character');
|
||||
}
|
||||
|
||||
if (!$properties) {
|
||||
|
@ -509,6 +509,16 @@ class TypeParseTest extends TestCase
|
||||
Type::parseString('max(a):void');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Psalm\Exception\TypeParseTreeException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGeneratorWithWBadBrackets()
|
||||
{
|
||||
Type::parseString('Generator{string, A}');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Psalm\Exception\TypeParseTreeException
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user