diff --git a/src/main/php/lang/ast/syntax/PHP.class.php b/src/main/php/lang/ast/syntax/PHP.class.php index cc669de..0250e79 100755 --- a/src/main/php/lang/ast/syntax/PHP.class.php +++ b/src/main/php/lang/ast/syntax/PHP.class.php @@ -1124,6 +1124,7 @@ private function properties($parse, &$body, $meta, $modifiers, $type, $holder) { /** Parses Hacklang-style annotations (<>) */ private function annotations($parse, $context) { + $parse->warn('Deprecated Hacklang-style annotations used'); $annotations= []; do { $name= $parse->token->value; diff --git a/src/test/php/lang/ast/unittest/parse/HackAnnotationsTest.class.php b/src/test/php/lang/ast/unittest/parse/HackAnnotationsTest.class.php index ac653ec..032b9fe 100755 --- a/src/test/php/lang/ast/unittest/parse/HackAnnotationsTest.class.php +++ b/src/test/php/lang/ast/unittest/parse/HackAnnotationsTest.class.php @@ -3,6 +3,11 @@ use lang\ast\nodes\{Annotated, Literal, ArrayLiteral}; use unittest\Assert; +/** + * Tests `<<...>>` style annotations + * + * @deprecated + */ class HackAnnotationsTest extends ParseTest { /** @@ -15,6 +20,7 @@ class HackAnnotationsTest extends ParseTest { */ private function assertAnnotations($expected, $code) { $children= $this->parse($code)->tree()->children(); + \xp::gc(); Assert::equals($expected, cast($children[sizeof($children) - 1], Annotated::class)->annotations); }