Skip to content

Commit 6970210

Browse files
committed
Add test for PFA inside annotations
See https://externals.io/message/127781#127793
1 parent ea7d77e commit 6970210

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/php/lang/ast/unittest/emit/CallableSyntaxTest.class.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,16 @@ public function run() {
303303
Assert::equals('tested', $result);
304304
Assert::equals(['arg', 'run', 'concat'], $invokations);
305305
}
306+
307+
#[Test]
308+
public function partial_function_application_inside_annotation() {
309+
$f= $this->run('use lang\Reflection; class %T {
310+
311+
#[Attr(strrev(?))]
312+
public function run() {
313+
return Reflection::of($this)->method("run")->annotation(Attr::class)->argument(0);
314+
}
315+
}');
316+
Assert::equals('cba', $f('abc'));
317+
}
306318
}

0 commit comments

Comments
 (0)