Skip to content

Commit

Permalink
Verify first-class callables work in annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Nov 2, 2024
1 parent 268c79e commit c60c1e2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ public function closure_value() {
Assert::equals('test', $verify[0]('test'));
}

#[Test]
public function first_class_callable_value() {
$verify= $this->annotations($this->declare('#[Verify(strtoupper(...))]'))['Verify'];
Assert::equals('TEST', $verify[0]('test'));
}

#[Test]
public function arrow_function_value() {
$verify= $this->annotations($this->declare('#[Verify(fn($arg) => $arg)]'))['Verify'];
Expand Down

0 comments on commit c60c1e2

Please sign in to comment.