diff --git a/src/Psalm/Internal/Type/ParseTreeCreator.php b/src/Psalm/Internal/Type/ParseTreeCreator.php index 15256e5de..0ee5d9b32 100644 --- a/src/Psalm/Internal/Type/ParseTreeCreator.php +++ b/src/Psalm/Internal/Type/ParseTreeCreator.php @@ -757,7 +757,10 @@ class ParseTreeCreator if ($nexter_token !== null && $nexter_token[0] === '}') { $new_leaf->terminated = true; ++$this->t; + } elseif ($nexter_token === null) { + throw new TypeParseTreeException('Unclosed bracket in keyed array'); } + break; case '(': diff --git a/tests/AnnotationTest.php b/tests/AnnotationTest.php index 2f7ec306d..506524aa2 100644 --- a/tests/AnnotationTest.php +++ b/tests/AnnotationTest.php @@ -1490,14 +1490,6 @@ class AnnotationTest extends TestCase ', 'error_message' => 'UndefinedDocblockClass', ], - 'preventBadTKeyedArrayFormat' => [ - ' 'InvalidDocblock', - ], 'noPhpStormAnnotationsThankYou' => [ '