Skip to content

Fix GH-8421: Attributes that target functions are not valid for anonymous functions defined within a method #8424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

ollieread
Copy link
Contributor

This fixes #8421, allowing anonymous functions defined within a method to have attributes targeting functions.

I've added tests for:

  • Closure defined in the global context
  • Static Closure defined in the global context
  • Closure defined in the context of ClosureHolder
  • Static Closure defined in the context of ClosureHolder
  • Closure defined inside ClosureHolder but within a static context
  • Static Closure defined inside ClosureHolder but within a static context

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

ollieread and others added 2 commits April 22, 2022 12:03
Added trailing newline, put the closure definition on the line after the attribute, and replaced echo with var_dump for output
@iluuu1994 iluuu1994 closed this in d0f1b98 Apr 23, 2022
@iluuu1994
Copy link
Member

@ollieread Thank you!

@ollieread ollieread deleted the closure-attribute-target-fix branch April 23, 2022 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants