diff --git a/src/test/php/lang/ast/unittest/parse/OperatorTest.class.php b/src/test/php/lang/ast/unittest/parse/OperatorTest.class.php index 6040b96..e2b9f6a 100755 --- a/src/test/php/lang/ast/unittest/parse/OperatorTest.class.php +++ b/src/test/php/lang/ast/unittest/parse/OperatorTest.class.php @@ -18,7 +18,7 @@ UnaryExpression, Variable }; -use lang\ast\types\{IsExpression, IsValue}; +use lang\ast\types\{IsExpression, IsGeneric, IsValue}; use test\{Assert, Test, Values}; class OperatorTest extends ParseTest { @@ -283,6 +283,18 @@ public function precedence_of_not_and_instance_of() { ); } + #[Test] + public function instanceof_generic() { + $this->assertParsed( + [new InstanceOfExpression( + new Variable('this', self::LINE), + new IsGeneric(new IsValue('self'), [new IsValue('T')]), + self::LINE + )], + '$this instanceof self;' + ); + } + #[Test, Values(['+', '-', '~'])] public function precedence_of_prefix($operator) { $this->assertParsed(